Home > @jsplumbtoolkit/core > Magnetizer > snapToGrid
#
Magnetizer.snapToGrid() methodSnaps all elements to a grid. Returns a map of element IDs, representing all the elements that were moved.
Signature:
snapToGrid(grid: Grid): Record<string, { original: PointXY; current: PointXY; }>;
#
ParametersParameter | Type | Description |
---|---|---|
grid | Grid |
Returns:
Record<string, { original: PointXY; current: PointXY; }>