Fix regression in shallow select (#3050)

* Add defer message for shallow select

* Fixed infinite loop
This commit is contained in:
Adesh Gupta 2025-08-15 16:25:05 +05:30 committed by GitHub
parent 67a7b98f4f
commit 99984fc2d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View File

@ -92,6 +92,7 @@ pub enum SelectToolMessage {
remove_from_selection: Key, remove_from_selection: Key,
}, },
EditLayer, EditLayer,
EditLayerExec,
Enter, Enter,
PointerMove(SelectToolPointerKeys), PointerMove(SelectToolPointerKeys),
PointerOutsideViewport(SelectToolPointerKeys), PointerOutsideViewport(SelectToolPointerKeys),
@ -323,6 +324,7 @@ impl<'a> MessageHandler<ToolMessage, &mut ToolActionMessageContext<'a>> for Sele
PointerMove, PointerMove,
Abort, Abort,
EditLayer, EditLayer,
EditLayerExec,
Enter, Enter,
); );
@ -985,14 +987,19 @@ impl Fsm for SelectToolFsmState {
self self
} }
(_, SelectToolMessage::EditLayer) => { (_, SelectToolMessage::EditLayer) => {
// Edit the clicked layer responses.add(DeferMessage::AfterGraphRun {
messages: vec![SelectToolMessage::EditLayerExec.into()],
});
self
}
(_, SelectToolMessage::EditLayerExec) => {
if let Some(intersect) = document.click(input) { if let Some(intersect) = document.click(input) {
match tool_data.nested_selection_behavior { match tool_data.nested_selection_behavior {
NestedSelectionBehavior::Shallowest => edit_layer_shallowest_manipulation(document, intersect, responses), NestedSelectionBehavior::Shallowest => edit_layer_shallowest_manipulation(document, intersect, responses),
NestedSelectionBehavior::Deepest => edit_layer_deepest_manipulation(intersect, &document.network_interface, responses), NestedSelectionBehavior::Deepest => edit_layer_deepest_manipulation(intersect, &document.network_interface, responses),
} }
} }
self self
} }
( (

View File

@ -288,7 +288,7 @@ impl NodeGraphExecutor {
} else { } else {
self.process_node_graph_output(node_graph_output, responses)?; self.process_node_graph_output(node_graph_output, responses)?;
} }
responses.add_front(DeferMessage::TriggerGraphRun(execution_id, execution_context.document_id)); responses.add(DeferMessage::TriggerGraphRun(execution_id, execution_context.document_id));
// Update the Data panel on the frontend using the value of the inspect result. // Update the Data panel on the frontend using the value of the inspect result.
if let Some(inspect_result) = (self.previous_node_to_inspect.is_some()).then_some(inspect_result).flatten() { if let Some(inspect_result) = (self.previous_node_to_inspect.is_some()).then_some(inspect_result).flatten() {