@mocanvas/editor · interface

TLCropInfo

interface TLCropInfo<T extends

A crop in progress, handed to ShapeUtil.onCrop.

SEMANTICS-ASSUMED: the field set mirrors ResizeInfo, which is the gesture this one is the sibling of — the handle being dragged, the movement so far, and the shape as it was when the gesture started, so a util can always recompute from the original instead of accumulating rounding error. uncroppedSize is what the shape's box would be showing the whole content at the current scale, which is what a util needs to convert a pixel drag into a normalized crop.


Properties · 6

change: VecLike

Movement since the gesture started, in the shape's own space.

crop: TLShapeCrop

The crop as it stands this frame.

handle: SelectionHandle

Which corner or edge is being dragged.

initialShape: T

The shape as it was when the crop gesture began.

props: object
uncroppedSize: {

The size the shape's box would have if nothing were cropped away.

Mentioned here

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.