@mocanvas/editor · function

getShapesPageBounds

declare function getShapesPageBounds(editor: Editor, ids: readonly (ShapeId | UnknownShape)[]): Box | null

The common page bounds of several shapes, clipping included, or null when none of them is visible.

Masked rather than raw bounds on purpose: this is what "zoom to these shapes" and "export these shapes" both want, and framing the invisible part of a shape scrolled out of its frame is never the intent.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.