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 <[email protected]>
This commit is contained in:
dchiassonandDavid Chiasson authored and Keavon Chambers committed 2022-07-20 04:26:10 +08:00
1 parent f77c1f2ef4
commit b4b667ded6
1 file changed
+1 -1
@@ -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;