@mocanvas/editor · interface
interface HandleSnapGeometryWhere a dragged *handle* may land on this shape.
- points are discrete targets: a handle within the snap threshold of one
jumps exactly onto it.
- outline is a continuous target: a handle near it slides to the nearest
point along it, which is how an arrow stays attached to the edge of a shape
while the shape is reshaped.
- getSelfSnapPoints / getSelfSnapOutline answer the same two questions
for the shape *being dragged* — a line's own earlier vertices, which it
should snap to even though it is not a separate shape.
Properties · 4
getSelfSnapOutline?(handleId: string): Geometry2d | nullThe outline of the shape being dragged that its own handle may slide along.
getSelfSnapPoints?(handleId: string): VecLike[]Points on the shape being dragged that its own handle may snap to.
outline?: Geometry2d | nullnull means "no outline to slide along", which is not the same as "use my geometry".
points?: VecLike[]mocanvas 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.