Skip to content

Commit

Permalink
made the required changes
Browse files Browse the repository at this point in the history
  • Loading branch information
0SlowPoke0 committed Jan 7, 2025
1 parent 0f9ed57 commit 1e16689
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions editor/src/messages/tool/tool_messages/select_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1102,17 +1102,13 @@ impl Fsm for SelectToolFsmState {

self
}
(SelectToolFsmState::DrawingBox { selection, previous_selected }, SelectToolMessage::RestoreSelection) => {
(SelectToolFsmState::DrawingBox { selection, mut previous_selected }, SelectToolMessage::RestoreSelection) => {
let selection_set: HashSet<_> = tool_data.previously_selected_layers.iter().collect();

if input.keyboard.key(Key::Shift) {
if previous_selected {
// if selected deselect it
tool_data.layers_dragging.retain(|layer| !selection_set.contains(layer));
} else {
tool_data.layers_dragging.extend(&tool_data.previously_selected_layers);
}
tool_data.layers_dragging.extend(&tool_data.previously_selected_layers);
previous_selected = false;
} else {
// On Shift release, finalize selection state
if previous_selected {
tool_data.layers_dragging.extend(&tool_data.previously_selected_layers);
} else {
Expand Down

0 comments on commit 1e16689

Please sign in to comment.