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:
parent
0f03762cff
commit
99a141c2e1
|
|
@ -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()))) {
|
else if intersection.is_some_and(|intersection| selected.iter().any(|selected_layer| intersection.starts_with(*selected_layer, document.metadata()))) {
|
||||||
responses.add(DocumentMessage::StartTransaction);
|
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;
|
tool_data.select_single_layer = intersection;
|
||||||
} else {
|
} else {
|
||||||
tool_data.select_single_layer = intersection.and_then(|intersection| intersection.ancestors(document.metadata()).find(|ancestor| selected.contains(ancestor)));
|
tool_data.select_single_layer = intersection.and_then(|intersection| intersection.ancestors(document.metadata()).find(|ancestor| selected.contains(ancestor)));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue