@mocanvas/mocanvas · function
declare function centerSelectionAroundPoint(editor: Editor, position: VecLike): voidMove the selection so its centre sits at position.
The last step of "create this shape where I dropped it": a tool creates the shape at whatever origin is convenient, then centres the result. Doing it as a translation of the finished selection rather than as an offset at creation time means it works the same for one shape and for twenty.
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.