Skip to content

Rect

Utils to compute intersection, union and area of bouding rectangles.

Functions

area()

function area(rect): number

Returns the area of a rectangle.

Parameters

rect: Rect

Returns

number

Defined in

tmp/commons/src/lib/utils/html.svelte.ts:125


intersection()

function intersection(rect, ...rects): Rect

Returns the intersection of multiple bouding rectangles.

Parameters

rect: Rect | DOMRect

• …rects: (Rect | DOMRect)[]

Returns

Rect

Defined in

tmp/commons/src/lib/utils/html.svelte.ts:81


pos()

function pos(rect): Position

Parameters

rect: Rect

Returns

Position

Defined in

tmp/commons/src/lib/utils/html.svelte.ts:129


union()

function union(rect, ...rects): Rect

Return the union of multiple bounding rectangles.

Parameters

rect: Rect

• …rects: Rect[]

Returns

Rect

Defined in

tmp/commons/src/lib/utils/html.svelte.ts:103