@mocanvas/editor · function

resizeScaled

declare function resizeScaled<T extends TLBaseBoxShape>(shape: T, info: ResizeInfo<T>): Partial<T>

Resize by scaling the whole shape, including whatever scale prop it keeps.

For shapes whose contents must not reflow: text that should keep its line breaks, a note whose font should grow with the box. The scale factor is the smaller of the two axes, so the shape stays proportional however the handle is dragged.

SEMANTICS-ASSUMED: the shape's own scale is read from and written to a numeric props.scale, which is the convention every scaling shape in this library uses; a shape without one is scaled in size only.

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.