util.pixelBounds

Static object.

Methods

Methods

Name

Returns

Description

areIntersecting(bounds1, bounds2)

Boolean

Determines whether two rectangular areas intersect.

containsBounds(outer, inner)

Boolean

Determines whether a rectangular area completely contains another rectangular area.

containsPoint(bounds, point)

Boolean

Determines whether a rectangular area contains a point.

fromBounds(sourceBounds)

Number[][]

Calculates the rectangular area that everything passed falls inside of.

fromPoints(points)

Number[][]

Calculates the rectangular area that the passed points fall inside of.

getCenter(bounds)

Number[]

Calculates the center of the rectangular area.

getIntersection(bounds1, bounds2)

Number[][]|null

Calculates the intersection of two rectangular areas.

getSize(bounds)

Number[]

Calculates the dimensions of a rectangular area.

Methods details

areIntersecting

{Boolean} areIntersecting(bounds1, bounds2)

Determines whether two rectangular areas intersect.

Returns intersection attribute.

Parameters:

Parameter

Default value

Description

bounds1*

Type: Number[][]

First area.

bounds2*

Type: Number[][]

Second area.

* Mandatory parameter/option.

containsBounds

{Boolean} containsBounds(outer, inner)

Determines whether a rectangular area completely contains another rectangular area.

Returns inclusion attribute.

Parameters:

Parameter

Default value

Description

outer*

Type: Number[][]

External area

inner*

Type: Number[][]

The area being checked.

* Mandatory parameter/option.

containsPoint

{Boolean} containsPoint(bounds, point)

Determines whether a rectangular area contains a point.

Returns inclusion attribute.

Parameters:

Parameter

Default value

Description

bounds*

Type: Number[][]

External area

point*

Type: Number[]

The point being checked.

* Mandatory parameter/option.

fromBounds

{Number[][]} fromBounds(sourceBounds)

Calculates the rectangular area that everything passed falls inside of.

Returns the calculated area.

Parameters:

Parameter

Default value

Description

sourceBounds*

Type: Number[][][]

Array of rectangular areas

* Mandatory parameter/option.

fromPoints

{Number[][]} fromPoints(points)

Calculates the rectangular area that the passed points fall inside of.

Returns the calculated area.

Parameters:

Parameter

Default value

Description

points*

Type: Number[][]

Array of points.

* Mandatory parameter/option.

getCenter

{Number[]} getCenter(bounds)

Calculates the center of the rectangular area.

Returns center point in the coordinate system of the input data.

Parameters:

Parameter

Default value

Description

bounds*

Type: Number[][]

Area.

* Mandatory parameter/option.

getIntersection

{Number[][]|null} getIntersection(bounds1, bounds2)

Calculates the intersection of two rectangular areas.

Returns the rectangular area that is formed by the intersection of the passed areas, or null if the areas do not intersect.

Parameters:

Parameter

Default value

Description

bounds1*

Type: Number[][]

First area.

bounds2*

Type: Number[][]

Second area.

* Mandatory parameter/option.

getSize

{Number[]} getSize(bounds)

Calculates the dimensions of a rectangular area.

Returns size of the area.

Parameters:

Parameter

Default value

Description

bounds*

Type: Number[][]

Area.

* Mandatory parameter/option.