@mocanvas/editor · class
declare abstract class BaseBoxShapeUtil<T extends UnknownShape &Shapes with w and h props.
Methods · 2
getGeometry(shape: T): Geometry2dThe box the shape's own w/h describe.
Supplying it is the greater half of what this base class is for: a subclass that draws its own body — a card of HTML, an embedded widget — has nothing to add here, and without it the shape has no geometry at all, so hit-testing, bounds and selection fail on first use rather than misbehaving visibly. Override it where the drawn body is not the full box.
onResize(shape: T, info: ResizeInfo<T>): Partial<T>Properties · 1
props: {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.