Rect
Rectangle is a shape composed of four points, used to represent a rectangular area.
Drawing Method
Click twice to complete drawing:
- First click to set one corner of the rectangle
- Move mouse to preview the rectangle in real-time
- Second click to set the opposite corner and complete drawing
You can hold the space key to pan the canvas while drawing.
Data
ts
export interface RectData extends BoundingBox, ShapeData {
shapeName: 'rect'
x: number
y: number
width: number
height: number
}