Skip to content

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

Function: dragBox() ​

dragBox(start, end, square): object

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

Box from drag start to end (whatever the drag direction)

Parameters ​

start ​

Vector2d

Corner where the drag started

end ​

Vector2d

Opposite corner (pointer)

square ​

boolean

Same width and height

Returns ​

Top left corner and positive size of the box

height ​

height: number

Height of the box, never negative

width ​

width: number

Width of the box, never negative

x ​

x: number

Left of the box

y ​

y: number

Top of the box