snapEdges()
function snapEdges( candidates, targets, tolerance): | { offset: number; position: number;} | null;Finds the closest target within tolerance for any of the candidate
edges. Returns the offset to apply and the matched position.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
candidates |
number[] |
targets |
number[] |
tolerance |
number |
Returns
Section titled “Returns”| {
offset: number;
position: number;
}
| null