HandleSnapGeometry
Table of contents
When dragging a handle, users can snap the handle to key geometry on other nearby shapes. Customize how handles snap to a shape by returning this from ShapeUtil.getHandleSnapGeometry.
Any co-ordinates here should be in the shape's local space.
interface HandleSnapGeometry {}
Properties
A Geometry2d
that describe the outline of the shape that the handle will snap to - fills
are ignored. By default, this is the same geometry returned by ShapeUtil.getGeometry.
Set this to null
to disable handle snapping to this shape's outline.
outline?: Geometry2d | null
Key points on the shape that the handle will snap to. For example, the corners of a rectangle, or the centroid of a triangle. By default, no points are used.
points?: VecModel[]
Methods
By default, handles can't snap to their own shape because moving the handle might change the
snapping location which can cause feedback loops. You can override this by returning a
version of outline
that won't be affected by the current handle's position to use for
self-snapping.
Name | Description |
---|---|
|
|
Geometry2d | null
By default, handles can't snap to their own shape because moving the handle might change the
snapping location which can cause feedback loops. You can override this by returning a
version of points
that won't be affected by the current handle's position to use for
self-snapping.
Name | Description |
---|---|
|
|
VecModel[]