Track which document the deferred executions belong to (#3010)

* Track which document the deferred executions belong to

* Cleanup

* Fix tests

* Fix freehand tool

* Notify defer handler of graph execution updates asap
This commit is contained in:
Dennis Kobert
2025-08-06 21:16:02 +02:00
committed by GitHub
parent 96a1b12a05
commit ef2fab32a2
11 changed files with 64 additions and 41 deletions
@@ -251,12 +251,8 @@ impl Fsm for FreehandToolFsmState {
let nodes = vec![(NodeId(0), node)];
let layer = graph_modification_utils::new_custom(NodeId::new(), nodes, parent, responses);
let defered_responses = &mut VecDeque::new();
tool_options.fill.apply_fill(layer, defered_responses);
tool_options.stroke.apply_stroke(tool_data.weight, layer, defered_responses);
responses.add(DeferMessage::AfterGraphRun {
messages: defered_responses.drain(..).collect(),
});
tool_options.fill.apply_fill(layer, responses);
tool_options.stroke.apply_stroke(tool_data.weight, layer, responses);
tool_data.layer = Some(layer);
FreehandToolFsmState::Drawing
@@ -706,6 +706,7 @@ impl Fsm for ShapeToolFsmState {
responses.add(DeferMessage::AfterGraphRun {
messages: defered_responses.drain(..).collect(),
});
responses.add(NodeGraphMessage::RunDocumentGraph);
ShapeToolFsmState::Drawing(tool_data.current_shape)
}