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

Snap everything to grid #315

Merged
merged 12 commits into from
Nov 18, 2024
Merged

Snap everything to grid #315

merged 12 commits into from
Nov 18, 2024

Conversation

webfiltered
Copy link
Contributor

@webfiltered webfiltered commented Nov 17, 2024

Snap everything to grid

  • Video starts with an item or two placed without snapping
  • On the first snap to grid, the spacing between items changes as they individually align
  • Once snapped, all subsequent movements snap and maintain spacing
snap-everything-to-grid.mp4

Code changes

  • Moves positioning logic to LGraph (from LGraphCanvas)
  • Simplifies code
  • Adds Pointer API to alt-clone node
  • Removes always_round_positions, replaced by LGraph.config.alwaysSnapToGrid (default size is 1 when always snapping)
  • Optimises reroute rendering
  • Snap guide shadow for all positionables

- Moves positioning logic to LGraph
- Simplifies code
- Adds Pointer API to alt-clone node
- Removes always_round_positions, replaced by always snap to grid (default size is 1 when always snapping)

Fix refator error
- Add snapToGrid to Positionable
- Impl. on all types
- Deprecated: alignToGrid is now a wrapper
Adds ability to perform late binding of finally() during drag start.
@webfiltered webfiltered changed the title Add Snap to grid for nodes Snap everything to grid Nov 17, 2024
@huchenlei huchenlei merged commit c0e8b33 into master Nov 18, 2024
3 of 4 checks passed
@huchenlei huchenlei deleted the snap-to-grid branch November 18, 2024 15:12
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