Skip to content

API / Rectangle

Class: Rectangle

Defined in: geom/Rectangle.ts:39

A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of one property has no effect on the others. However, the right and bottom properties are integrally related to those four properties. For example, if you change the value of the right property, the value of the width property changes; if you change the bottom property, the value of the height property changes.

Properties

height

ts
height: number;

Defined in: geom/Rectangle.ts:75

矩形的高度(以像素为单位)。

Default

ts
0.0

width

ts
width: number;

Defined in: geom/Rectangle.ts:66

The width of the rectangle, in pixels.

Default

ts
0.0

x

ts
x: number;

Defined in: geom/Rectangle.ts:48

The x coordinate of the top-left corner of the rectangle.

Default

ts
0.0

y

ts
y: number;

Defined in: geom/Rectangle.ts:57

The y coordinate of the top-left corner of the rectangle.

Default

ts
0.0

Released under the MIT License.