Skip to main content

Class: GeometryUtils

Defined in: utils/GeometryUtils.ts:4

Utility methods for rectangle and dimension geometry

Constructors

Constructor

new GeometryUtils(): GeometryUtils

Returns

GeometryUtils

Methods

boundingBox()

static boundingBox(...rects): Rect | null

Defined in: utils/GeometryUtils.ts:11

Computes the union of multiple rectangles and returns the smallest rectangle that contains all of them

Parameters

rects

...Rect[]

The rectangles to compute the union of

Returns

Rect | null

The smallest rectangle that contains all the input rectangles, or null if no rectangles are provided


dimsEquals()

static dimsEquals(a, b): boolean

Defined in: utils/GeometryUtils.ts:31

Checks if two dimensions are equal by comparing their width and height properties

Parameters

a

Dims

The first dimensions to compare

b

Dims

The second dimensions to compare

Returns

boolean

true if the dimensions are equal, false otherwise


rectEquals()

static rectEquals(a, b): boolean

Defined in: utils/GeometryUtils.ts:42

Checks if two rectangles are equal by comparing their x, y, width, and height properties

Parameters

a

Rect

The first rectangle to compare

b

Rect

The second rectangle to compare

Returns

boolean

true if the rectangles are equal, false otherwise