Skip to content

@aninest/extensions / Snap

Snap

Snaps the animation to predetermined points before ending.

Index

Snap

Type alias, FunctionDescription
ShouldSnap-
distanceLessThanReturns a function of whether the provided distance is smaller than the distance between the current state and an arbitrary point. Mainly meant as a utility function for setSnapPoint.
distanceSquaredBetweenMeasures the squared euclidean distance between the point and the currentState across the features in the point.
setLocalSnapGridSets a snap grid only for the top level of the animation.
setSnapGridAdds a grid to snap to.
setSnapPointAdds a point to snap to, across any number of features.