Skip to content

Region

Defined in: src/geometry/region.ts:5

An immutable rectangle (offset + size) in cell coordinates — a widget’s region.

new Region(offset, size): Region

Defined in: src/geometry/region.ts:6

Offset

Top-left corner.

Size

Width × height.

Region

readonly offset: Offset

Defined in: src/geometry/region.ts:8

Top-left corner.


readonly size: Size

Defined in: src/geometry/region.ts:10

Width × height.


readonly static EMPTY: Region

Defined in: src/geometry/region.ts:14

An empty region at the origin.

get bottom(): number

Defined in: src/geometry/region.ts:38

One past the bottom edge (y + height).

number


get height(): number

Defined in: src/geometry/region.ts:29

Height in cells.

number


get right(): number

Defined in: src/geometry/region.ts:34

One past the right edge (x + width).

number


get width(): number

Defined in: src/geometry/region.ts:25

Width in cells.

number


get x(): number

Defined in: src/geometry/region.ts:17

Left edge (column).

number


get y(): number

Defined in: src/geometry/region.ts:21

Top edge (row).

number

clone(): Region

Defined in: src/geometry/region.ts:96

A copy of this region.

Region


contains(x, y): boolean

Defined in: src/geometry/region.ts:43

True if the point lies inside this region (right/bottom edges exclusive).

number

number

boolean

contains(offset): boolean

Defined in: src/geometry/region.ts:44

True if the point lies inside this region (right/bottom edges exclusive).

Offset

boolean


containsRegion(other): boolean

Defined in: src/geometry/region.ts:56

True if other lies entirely within this region.

Region

boolean


equals(other): boolean

Defined in: src/geometry/region.ts:91

True if offset and size both match.

Region

boolean


intersection(other): Region | null

Defined in: src/geometry/region.ts:78

The overlapping region, or null if they don’t overlap.

Region

Region | null


overlaps(other): boolean

Defined in: src/geometry/region.ts:70

True when the two regions overlap. A non-allocating predicate for hot paths (e.g. per-child clip culling each frame) that only need a yes/no, not the intersection rectangle itself.

Region

boolean


toString(): string

Defined in: src/geometry/region.ts:101

"(x,y WxH)".

string