[]
        
(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)

Represents a rectangle with a special location, and its width and height in two-dimensional space.

Parameters

Name Type Description
x number The x-coordinate of the top-left corner of the rectangle.
y number The y-coordinate of the top-left corner of the rectangle.
w number The width of the rectangle.
h number The height of the rectangle.

Properties

height

height: number

The width of the rectangle.


width

width: number

The height of the rectangle.


x

x: number

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


y

y: number

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

Methods

contains

contains(x, y): boolean

Indicates whether the rectangle contains the specified x-coordinate and y-coordinate.

Parameters

Name Type Description
x number The x-coordinate of the point to check.
y number The y-coordinate of the point to check.

Returns

boolean

true if (x, y) is contained by the rectangle; otherwise, false.


getIntersectRect

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

Gets the rectangle that intersects with the current rectangle.

Parameters

Name Type
x number
y number
width number
height number

Returns

Rect

The intersecting rectangle. If the two rectangles do not intersect, returns null.


intersect

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

Indicates whether the specified rectangle intersects with the current rectangle.

Parameters

Name Type Description
x number The x-coordinate of the top-left corner of the rectangle.
y number The y-coordinate of the top-left corner of the rectangle.
width number -
height number -

Returns

boolean

true if the specified rectangle intersects with the current rectangle; otherwise, false.


intersectRect

intersectRect(rect): boolean

Indicates whether the specified rectangle intersects with the current rectangle.

Parameters

Name Type Description
rect Rect The specified rectangle.

Returns

boolean

true if the specified rectangle intersects with the current rectangle; otherwise, false.