[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

GC.Spread.Sheets.Rect

Class: Rect

Spread.Sheets.Rect

Table of contents

Constructors

Properties

Methods

Constructors

constructor

• new Rect(x, y, w, h)

表示二维空间中具有特定位置、宽度和高度的矩形。

Parameters

Name Type Description
x number 矩形左上角的 x 坐标。
y number 矩形左上角的 y 坐标。
w number 矩形的宽度。
h number 矩形的高度。

Properties

height

• height: number

矩形的宽度。


width

• width: number

矩形的高度。


x

• x: number

矩形左上角的 x 坐标。


y

• y: number

矩形左上角的 y 坐标。

Methods

contains

▸ contains(x, y): boolean

指示矩形是否包含指定的 x 坐标和 y 坐标。

Parameters

Name Type Description
x number 要检查的点的 x 坐标。
y number 要检查的点的 y 坐标。

Returns

boolean

如果 (x, y) 被矩形包含,则为 true;否则为 false。


getIntersectRect

▸ getIntersectRect(x, y, width, height): Rect

获取与当前矩形相交的矩形。

Parameters

Name Type
x number
y number
width number
height number

Returns

Rect

相交的矩形。如果两个矩形不相交,则返回 null。


intersect

▸ intersect(x, y, width, height): boolean

指示指定的矩形是否与当前矩形相交。

Parameters

Name Type Description
x number 矩形左上角的 x 坐标。
y number 矩形左上角的 y 坐标。
width number -
height number -

Returns

boolean

如果指定的矩形与当前矩形相交,则为 true;否则为 false。


intersectRect

▸ intersectRect(rect): boolean

指示指定的矩形是否与当前矩形相交。

Parameters

Name Type Description
rect Rect 指定的矩形。

Returns

boolean

如果指定的矩形与当前矩形相交,则为 true;否则为 false。