diff --git a/packages/tldraw/src/state/TldrawApp.ts b/packages/tldraw/src/state/TldrawApp.ts index 8081c19f2..874df23e9 100644 --- a/packages/tldraw/src/state/TldrawApp.ts +++ b/packages/tldraw/src/state/TldrawApp.ts @@ -1557,6 +1557,7 @@ export class TldrawApp extends StateManager { */ copySvg = (ids = this.selectedIds, pageId = this.currentPageId) => { if (ids.length === 0) ids = Object.keys(this.page.shapes) + if (ids.length === 0) return const shapes = ids.map((id) => this.getShape(id, pageId)) const commonBounds = Utils.getCommonBounds(shapes.map(TLDR.getRotatedBounds)) @@ -1643,6 +1644,8 @@ export class TldrawApp extends StateManager { */ copyJson = (ids = this.selectedIds, pageId = this.currentPageId) => { if (ids.length === 0) ids = Object.keys(this.page.shapes) + if (ids.length === 0) return + const shapes = ids.map((id) => this.getShape(id, pageId)) const json = JSON.stringify(shapes, null, 2) TLDR.copyStringToClipboard(json)