Snap a value to nearest grid slice, using rounding.
Example: if you have an interval gap of 5 and a position of 12... you will snap to 10 whereas 14 will snap to 15.
5
12
10
14
15
The value to snap.
The interval gap of the grid.
Optional
Optional starting offset for gap. Default 0.
If true it will divide the snapped value by the gap before returning. Default false.
true
Snap a value to nearest grid slice, using rounding.
Example: if you have an interval gap of
5and a position of12... you will snap to10whereas14will snap to15.