Skip to content
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

Fix always snap to grid #1604

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Fix always snap to grid #1604

merged 1 commit into from
Nov 19, 2024

Conversation

huchenlei
Copy link
Member

Resolves #1601

Here are some context on watchEffect in Vue:

How It Works:

  • When the callback first runs, Vue creates an internal "effect scope"
  • During execution, Vue records all reactive properties that are read
  • Any time one of these tracked dependencies changes:
  • The callback is automatically re-run
  • Dependencies are re-tracked (they can change between executions)\

Important Notes:

  • Only reactive property reads are tracked, not writes
  • The tracking is automatic - you don't need to specify dependencies like in watch
  • Tracking only works for synchronous access within the callback
  • Nested function calls are also tracked as long as they're synchronous

Previously the issue was that on the first execution, the graph does not exist and the setting reactive state is not accessed. comfyApp.graph is also not reactive, so when it becomes available later, the effect is also not triggered.

@huchenlei huchenlei merged commit 2a7df57 into main Nov 19, 2024
9 checks passed
@huchenlei huchenlei deleted the fix_always_snap branch November 19, 2024 17:10
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.

[Bug]: Always snap to grid not working since 1.4.3
1 participant