@mocanvas/editor · function

animateShape

declare function animateShape(editor: Editor, partial: ShapePartial<UnknownShape> | null | undefined, opts?: TLAnimationOptions): void

Move a shape to a new position/rotation/opacity over time.

Every frame is written with history: "ignore", and one stopping point is marked before the animation starts — so an animation is a single undo step that lands on the *destination*, not a hundred steps ending wherever the user happened to press undo.

Only the numeric top-level fields are interpolated; anything else in the partial (props, meta, parent) is applied once, at the start, because there is no general way to interpolate an arbitrary prop.

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.