From 737e1dda0d5efc529d443a39bbbfac33b9255182 Mon Sep 17 00:00:00 2001 From: Steve Ruiz Date: Sat, 4 Sep 2021 22:40:37 +0100 Subject: [PATCH] Update tlstate.ts --- packages/tldraw/src/state/tlstate.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/tldraw/src/state/tlstate.ts b/packages/tldraw/src/state/tlstate.ts index 71fa16c5a..7e7d12631 100644 --- a/packages/tldraw/src/state/tlstate.ts +++ b/packages/tldraw/src/state/tlstate.ts @@ -685,7 +685,7 @@ export class TLDrawState extends StateManager { /* -------------------------------------------------- */ /** - * Create a new page page. + * Create a new page. * @param pageId (optional) The new page's id. * @returns this */ @@ -890,7 +890,7 @@ export class TLDrawState extends StateManager { } /** - * Copy one or more shapes as JSON + * Copy one or more shapes as JSON. * @param ids The ids of the shapes to copy. * @param pageId The page from which to copy the shapes. * @returns A string containing the JSON. @@ -1927,6 +1927,12 @@ export class TLDrawState extends StateManager { return this } + /** + * Create a new shape based on the active tool. + * @param point The point at which to create the shape + * @param id (optional) The new shape's id. + * @returns + */ createActiveToolShape = (point: number[], id = Utils.uniqueId()): this => { const pagePoint = Vec.round(this.getPagePoint(point))