Skip to content

Documentation / @ripl/core / Box

Class: Box ​

Defined in: packages/core/src/math/structs.ts:2

An axis-aligned bounding box defined by its four edges.

Constructors ​

Constructor ​

new Box(top, left, bottom, right): Box

Defined in: packages/core/src/math/structs.ts:4

Parameters ​

ParameterType
topnumber
leftnumber
bottomnumber
rightnumber

Returns ​

Box

Properties ​

PropertyModifierTypeDefined in
bottompublicnumberpackages/core/src/math/structs.ts:7
leftpublicnumberpackages/core/src/math/structs.ts:6
rightpublicnumberpackages/core/src/math/structs.ts:8
toppublicnumberpackages/core/src/math/structs.ts:5

Accessors ​

height ​

Get Signature ​

get height(): number

Defined in: packages/core/src/math/structs.ts:22

The vertical span of the box.

Returns ​

number


width ​

Get Signature ​

get width(): number

Defined in: packages/core/src/math/structs.ts:17

The horizontal span of the box.

Returns ​

number

Methods ​

empty() ​

static empty(): Box

Defined in: packages/core/src/math/structs.ts:12

Creates a zero-sized box at the origin.

Returns ​

Box