Snap to Grid

Snaps the layer's position to a defined grid.

Code

gridSize = 50;
[ Math.round(value[0] / gridSize) * gridSize, Math.round(value[1] / gridSize) * gridSize ]
gridpositionsnap

How to Use

Use on the Position property to constrain movement to a grid. Adjust the `gridSize` variable to change the snapping intervals.