Web SDKv1.0.0

Helpers.quadToRect()

A Quad's bounds, as a Rect.
static methodGeometrysince 1.0.0

Signature

quadToRect(quad: Quad): Rect

Parameters

ParameterTypeDescription
quadQuad{ topLeft, topRight, bottomLeft, bottomRight } — one line a text mark covers.

Returns

Rect The bounds of the quad.

Example

TypeScript
const [first] = highlight.quads ?? [];
const firstLine = first ? quadToRect(first) : null;

More in Helpers