Skip to content

Commit 6c1ccfb

Browse files
authored
Fix regression causing last selected layer to not be deselected (#2656)
Fix last selected layer not being deselected because .take() was placed inside if block
1 parent f624edb commit 6c1ccfb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

editor/src/messages/tool/tool_messages/select_tool.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -641,13 +641,13 @@ impl Fsm for SelectToolFsmState {
641641
}
642642
}
643643

644-
if overlay_context.visibility_settings.transform_cage() {
645-
if let Some(bounds) = bounds {
646-
let bounding_box_manager = tool_data.bounding_box_manager.get_or_insert(BoundingBoxManager::default());
644+
if let Some(bounds) = bounds {
645+
let bounding_box_manager = tool_data.bounding_box_manager.get_or_insert(BoundingBoxManager::default());
647646

648-
bounding_box_manager.bounds = bounds;
649-
bounding_box_manager.transform = transform;
650-
bounding_box_manager.transform_tampered = transform_tampered;
647+
bounding_box_manager.bounds = bounds;
648+
bounding_box_manager.transform = transform;
649+
bounding_box_manager.transform_tampered = transform_tampered;
650+
if overlay_context.visibility_settings.transform_cage() {
651651
bounding_box_manager.render_overlays(&mut overlay_context, true);
652652
}
653653
} else {
@@ -681,7 +681,7 @@ impl Fsm for SelectToolFsmState {
681681

682682
let is_resizing_or_rotating = matches!(self, SelectToolFsmState::ResizingBounds | SelectToolFsmState::SkewingBounds { .. } | SelectToolFsmState::RotatingBounds);
683683

684-
if overlay_context.visibility_settings.transform_cage() && bounds.is_some() {
684+
if overlay_context.visibility_settings.transform_cage() {
685685
if let Some(bounds) = tool_data.bounding_box_manager.as_mut() {
686686
let edges = bounds.check_selected_edges(input.mouse.position);
687687
let is_skewing = matches!(self, SelectToolFsmState::SkewingBounds { .. });

0 commit comments

Comments
 (0)