Skip to content

Conversation

@huchenlei
Copy link
Contributor

@huchenlei huchenlei commented Oct 8, 2024

Make LGraphCanvas shallowReactive, i.e. only changes on root LGraphCanvas are reactive.

This change allows us observing changes to various LGraphCanvas root states without relying on LGraphCanvas emitting events.

Note

According to code search, there is no check against instanceof LGraphCanvas in public ComfyUI repo, so replacing app.canvas with a Proxy of LGraphCanvas should not cause any immediate break on extensions.

@huchenlei
Copy link
Contributor Author

Seems like the DOM Widget's pointerEvent is broken by this PR. When dragging a node over a DOM widget, the DOM widget is capturing the pointer event, resulting canvas losing point event tracking.

@huchenlei
Copy link
Contributor Author

Seems like the DOM Widget's pointerEvent is broken by this PR. When dragging a node over a DOM widget, the DOM widget is capturing the pointer event, resulting canvas losing point event tracking.

It turns out LGraphCanvas.options.skip_events is also used after LGraphCanvas creation. Restoring that value to false fixes the problem.

@huchenlei huchenlei merged commit 2cb1cea into main Oct 8, 2024
@huchenlei huchenlei deleted the shallow_canvas branch October 8, 2024 18:07
benceruleanlu pushed a commit that referenced this pull request Aug 3, 2025
Co-authored-by: christian-byrne <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants