@mocanvas/mocanvas · interface

OnDragFromToolbarToCreateShapesOpts

interface OnDragFromToolbarToCreateShapesOpts

What onDragFromToolbarToCreateShape needs from the toolbar button.


Methods · 1

createShape(id: ShapeId): void

Create the shape being dragged, under this id.

Position is not passed in: the shape is created wherever the util's defaults put it and then centred on the drop point, so a caller only has to know what it is making, not where.


Properties · 2

maskedToolId?: string

The toolbar tool to keep highlighted while the drag is in flight.

onDragEnd?(id: ShapeId): void

Called once the shape is placed, for a tool that wants to start editing it.

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.