From b6793517e25f1d423f8f65f610cfb3783b3397aa Mon Sep 17 00:00:00 2001 From: dchiasson <1863441+dchiasson@users.noreply.github.com> Date: Wed, 20 Jul 2022 04:26:10 +0800 Subject: [PATCH] Improve behavior of occluded layer selection and dragging (#732) Improve behavior of occluded layer dragging Layers or groups of layers can only be dragged if they are not occluded at the point of dragging. Otherwise the layer(s) are deselected and the occluding layer is selected instead. Closes #705 Co-authored-by: David Chiasson --- editor/src/viewport_tools/tools/select_tool.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/src/viewport_tools/tools/select_tool.rs b/editor/src/viewport_tools/tools/select_tool.rs index 512fb05f97..617749c704 100644 --- a/editor/src/viewport_tools/tools/select_tool.rs +++ b/editor/src/viewport_tools/tools/select_tool.rs @@ -445,7 +445,7 @@ impl Fsm for SelectToolFsmState { tool_data.layers_dragging = selected; RotatingBounds - } else if selected.iter().any(|path| intersection.contains(path)) { + } else if intersection.last().map(|last| selected.contains(last)).unwrap_or(false) { responses.push_back(DocumentMessage::StartTransaction.into()); tool_data.layers_dragging = selected;