-
-
Notifications
You must be signed in to change notification settings - Fork 831
Add handler for deferred execution of messages #2951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7f30d29
to
45095a3
Compare
3fb53af
to
35ce634
Compare
@@ -1435,6 +1435,20 @@ impl MessageHandler<DocumentMessage, DocumentMessageContext<'_>> for DocumentMes | |||
}, | |||
}) | |||
} | |||
// Some parts of the editior depend on these bounds to be present |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what parts? (answer: zooming to fill bounds) Ideally the editor should not be aware of the bounds at all, since it treats the top left corner of the vieport at (0,0). Only the executor should know the bounds in order to evaluate the node graph.
editor/src/messages/portfolio/document/document_message_handler.rs
Outdated
Show resolved
Hide resolved
DeferMessage::AfterGraphRun { mut messages } => { | ||
self.after_graph_run.extend(messages.drain(..).map(|m| (self.current_graph_submission_id, m))); | ||
} | ||
DeferMessage::AfterViewportReady { messages } => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not be possible to add messages to this buffer if there are currently bounds. An if statement in here would be a good prevention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is not the responsibility of this message handler and would violate architectural separation. And it is possible to use this callback even if bounds are present and the code still works
editor/src/messages/tool/common_functionality/graph_modification_utils.rs
Show resolved
Hide resolved
35ce634
to
a42965f
Compare
f962d8f
to
56e66e9
Compare
56e66e9
to
366c3ff
Compare
This avoids blocking all message processing until a graph execution has been completed