Helpers.quadToRect()
A
Quad's bounds, as a Rect.static methodGeometrysince 1.0.0
Signature
quadToRect(quad: Quad): Rect
Parameters
| Parameter | Type | Description |
|---|---|---|
| quad | Quad | { 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;