Skip to content

feat(api): allow custom relative snap points for handles#6987

Merged
mimecuvalo merged 4 commits intotldraw:mainfrom
nehaaprasad:feat/allow-custom
Oct 30, 2025
Merged

feat(api): allow custom relative snap points for handles#6987
mimecuvalo merged 4 commits intotldraw:mainfrom
nehaaprasad:feat/allow-custom

Conversation

@nehaaprasad
Copy link
Copy Markdown
Contributor

@nehaaprasad nehaaprasad commented Oct 22, 2025

fixes: #6975

  • adds getAdjacentHandleForShiftSnapping() method to ShapeUtil to allow custom shapes to define which handle should be used as the reference point when dragging handles with shift key for angle snapping.

  • fixes janky snapping behavior in shapes like bezier curves where control points need to snap relative to specific anchor points instead of the default "next adjacent handle" logic.

Change type

  • feature

Test plan

  1. Added unit tests for custom adjacent handle snapping behavior
  2. All existing tests pass, ensuring backward compatibility
  • Unit tests
  • End to end tests

Release notes

  • Added support for custom relative snap points for handles via getAdjacentHandleForShiftSnapping and snapReferenceHandleId.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api API change feature New feature sdk Affects the tldraw sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow custom relative snap points for handles

5 participants