From 7f40fad2d28425ec45642f6cd6fe6d13888d7c63 Mon Sep 17 00:00:00 2001 From: 0SlowPoke0 Date: Tue, 7 Jan 2025 13:22:27 +0530 Subject: [PATCH] made the required changes --- .../src/messages/tool/tool_messages/select_tool.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/editor/src/messages/tool/tool_messages/select_tool.rs b/editor/src/messages/tool/tool_messages/select_tool.rs index 3c7ada69d4..d379583a0e 100644 --- a/editor/src/messages/tool/tool_messages/select_tool.rs +++ b/editor/src/messages/tool/tool_messages/select_tool.rs @@ -1112,17 +1112,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 {