Fix shallow select mode not allowing a Ctrl-click select deepest if the 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 <keavon@keavon.com>
This commit is contained in:
Priyanshu 2025-02-05 11:09:40 +05:30 committed by GitHub
parent 0f03762cff
commit 99a141c2e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -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)));