Documentation / Snap / setSnapGrid
setSnapGrid()
ts
function setSnapGrid<Animating>(anim, gridSize): unsubscribe;
Defined in: ../../extensions/src/snap.ts:45
Adds a grid to snap to.
Type Parameters
Animating
Animating
extends Animatable
<unknown
>
Parameters
anim
Animation
<Animating
>
gridSize
PartialRecursiveAnimatable
<Animating
>
A dictionary of the size of each grid square for each variable. Ex: {x: 1, y: 1}
Returns
unsubscribe
a function to remove the snap grid
Example
ts
setSnapGrid(anim, {x: 1, y: 1}) // will snap to integer values before ending