|
|
|
|
1557
|
*/
|
1557
|
*/
|
1558
|
copySvg = (ids = this.selectedIds, pageId = this.currentPageId) => {
|
1558
|
copySvg = (ids = this.selectedIds, pageId = this.currentPageId) => {
|
1559
|
if (ids.length === 0) ids = Object.keys(this.page.shapes)
|
1559
|
if (ids.length === 0) ids = Object.keys(this.page.shapes)
|
|
|
1560
|
+ if (ids.length === 0) return
|
1560
|
|
1561
|
|
1561
|
const shapes = ids.map((id) => this.getShape(id, pageId))
|
1562
|
const shapes = ids.map((id) => this.getShape(id, pageId))
|
1562
|
const commonBounds = Utils.getCommonBounds(shapes.map(TLDR.getRotatedBounds))
|
1563
|
const commonBounds = Utils.getCommonBounds(shapes.map(TLDR.getRotatedBounds))
|
|
|
|
|
1643
|
*/
|
1644
|
*/
|
1644
|
copyJson = (ids = this.selectedIds, pageId = this.currentPageId) => {
|
1645
|
copyJson = (ids = this.selectedIds, pageId = this.currentPageId) => {
|
1645
|
if (ids.length === 0) ids = Object.keys(this.page.shapes)
|
1646
|
if (ids.length === 0) ids = Object.keys(this.page.shapes)
|
|
|
1647
|
+ if (ids.length === 0) return
|
|
|
1648
|
+
|
1646
|
const shapes = ids.map((id) => this.getShape(id, pageId))
|
1649
|
const shapes = ids.map((id) => this.getShape(id, pageId))
|
1647
|
const json = JSON.stringify(shapes, null, 2)
|
1650
|
const json = JSON.stringify(shapes, null, 2)
|
1648
|
TLDR.copyStringToClipboard(json)
|
1651
|
TLDR.copyStringToClipboard(json)
|