@mocanvas/editor · class
declare class HandleSnapsHandle snapping: finding somewhere for a dragged endpoint to land.
Reached as editor.snaps.handles. Distinct from bounds snapping because the
answer is a *point*, not an alignment: an arrow endpoint dropped near a
rectangle should attach to the rectangle's outline, which has nothing to do
with whether any edges line up.
Methods · 2
constructor(manager: SnapManager)snapHandle({ currentShapeId, handle }: HandleSnapOptions): SnapData | nullWhere a dragged handle should actually go, or null when nothing is close
enough.
Discrete points win over outlines within the same threshold: a point is a deliberate target a shape offered, while an outline is a continuum, and landing exactly on a named point is almost always what was meant.
Properties · 2
readonly editor: Editorreadonly manager: SnapManagermocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.