@mocanvas/mocanvas · interface
interface OnDragFromToolbarToCreateShapesOptsWhat onDragFromToolbarToCreateShape needs from the toolbar button.
Methods · 1
createShape(id: ShapeId): voidCreate 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?: stringThe toolbar tool to keep highlighted while the drag is in flight.
onDragEnd?(id: ShapeId): voidCalled once the shape is placed, for a tool that wants to start editing it.
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.