Skip to content

@fabwcie/free-drawing / components/toolbar/widgets/ShapeWidget / snapAngle

Function: snapAngle() ​

snapAngle(start, end): Vector2d

Defined in: packages/free-drawing/src/components/toolbar/widgets/ShapeWidget.ts:20

Point at the same distance from start as end, in the nearest 45 degrees direction

Parameters ​

start ​

Vector2d

Fixed point (drag start)

end ​

Vector2d

Point to snap (pointer)

Returns ​

Vector2d

End moved on the nearest multiple of 45 degrees around start