Skip to content

Rect

A 2D, axis-aligned, floating-point rectangle whose coordinates are relative to a given origin.

属性 ​

名称类型默认值说明
leftNumberrequiredThe offset of the left edge of this rectangle from the x-axis.
topNumberrequiredThe offset of the top edge of this rectangle from the y-axis.
rightNumberrequiredThe offset of the right edge of this rectangle from the x-axis.
bottomNumberrequiredThe offset of the bottom edge of this rectangle from the y-axis.

只读属性 ​

名称类型默认值说明
widthNumber—The distance between the left and right edges of this rectangle.
heightNumber—The distance between the top and bottom edges of this rectangle.
sizeSize—The distance between the upper-left corner and the lower-right corner of this rectangle.

方法 ​

名称类型默认值说明
copy'Rect'—返回此对象的副本,可覆盖指定属性。
from_lwth'Rect'—Construct a rectangle from its left and top edges, its width, and its height.
from_center——Constructs a rectangle from its center point, width, and height. The center argument is assumed to be an offset from the origin.
from_points——Construct the smallest rectangle that encloses the given offsets, treating them as vectors from the origin.

关注我,学习大模型、大数据、Python等热门技术。