Skip to content

API / Rectangle

类: Rectangle

定义于: geom/Rectangle.ts:39

Rectangle 对象是按其位置(由它左上角的点 (x, y) 确定)以及宽度和高度定义的区域。
Rectangle 类的 x、y、width 和 height 属性相互独立;更改一个属性的值不会影响其他属性。 但是,right 和 bottom 属性与这四个属性是整体相关的。例如,如果更改 right 属性的值,则 width 属性的值将发生变化;如果更改 bottom 属性,则 height 属性的值将发生变化。

属性

height

ts
height: number;

定义于: geom/Rectangle.ts:75

The height of the rectangle, in pixels.

默认值

ts
0.0

width

ts
width: number;

定义于: geom/Rectangle.ts:66

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

默认值

ts
0.0

x

ts
x: number;

定义于: geom/Rectangle.ts:48

矩形左上角的 x 坐标。

默认值

ts
0.0

y

ts
y: number;

定义于: geom/Rectangle.ts:57

矩形左上角的 y 坐标。

默认值

ts
0.0

Released under the MIT License.