Skip to content

Commit

Permalink
Fix shallow select mode not allowing a Ctrl-click select deepest if t…
Browse files Browse the repository at this point in the history
…he target's ancestor is already selected (#2247)

* Fix deepselect with control key not working when shallow select mode set.

* refactor

---------

Co-authored-by: Keavon Chambers <[email protected]>
  • Loading branch information
indierusty and Keavon authored Feb 5, 2025
1 parent 0f03762 commit 99a141c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editor/src/messages/tool/tool_messages/select_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ impl Fsm for SelectToolFsmState {
else if intersection.is_some_and(|intersection| selected.iter().any(|selected_layer| intersection.starts_with(*selected_layer, document.metadata()))) {
responses.add(DocumentMessage::StartTransaction);

if tool_data.nested_selection_behavior == NestedSelectionBehavior::Deepest {
if input.keyboard.key(select_deepest) || tool_data.nested_selection_behavior == NestedSelectionBehavior::Deepest {
tool_data.select_single_layer = intersection;
} else {
tool_data.select_single_layer = intersection.and_then(|intersection| intersection.ancestors(document.metadata()).find(|ancestor| selected.contains(ancestor)));
Expand Down

0 comments on commit 99a141c

Please sign in to comment.