Position to transform
Definition of the grid
Optional
thresholdX: numberDefines how close to a grid line in the x axis a value must be in order to be snapped to it.
Optional
thresholdY: numberDefines how close to a grid line in the y axis a value must be in order to be snapped to it.
The point to which the position was snapped, given the constraints of the grid.
Snap the given x,y to a point on the grid defined by gridX and gridY, using the given thresholds to calculate proximity to the grid.