tldraw / tldraw-v1

A tiny little drawing app. This is the original 2021-2022 version, released under MIT.
https://old.tldraw.com
MIT License
61 stars 36 forks source link

[bug] Grouped objects are duplicated in the SVG #87

Closed ubitux closed 8 months ago

ubitux commented 1 year ago

Grouped objects (through Ctrl-G) are duplicated in the SVG.

This is how it looks when the SVG is loaded into Inkscape (rectangle and circle are grouped together):

https://user-images.githubusercontent.com/34467/198856722-8c446a1a-ca55-40a7-94a4-eede26ce3aeb.mp4

Here is the tldr file:

{"name":"New Document","fileHandle":null,"document":{"id":"doc","name":"New Document","version":15.5,"pages":{"page":{"id":"page","name":"Page 1","childIndex":1,"shapes":{"90f4b27c-610d-4cca-1969-06292a90ce1e":{"id":"90f4b27c-610d-4cca-1969-06292a90ce1e","type":"rectangle","name":"Rectangle","parentId":"52fe9b12-d005-4b72-149c-db3937d30da9","childIndex":1,"point":[326.59,129.04],"size":[476.46,314.29],"rotation":0,"style":{"color":"blue","size":"small","isFilled":true,"dash":"draw","scale":1},"label":"","labelPoint":[0.5,0.5]},"19de3448-7914-41d1-291a-4b28d963d827":{"id":"19de3448-7914-41d1-291a-4b28d963d827","type":"ellipse","name":"Ellipse","parentId":"52fe9b12-d005-4b72-149c-db3937d30da9","childIndex":2,"point":[658.31,296.74],"radius":[155.8013655975053,156.72280229749057],"rotation":0,"style":{"color":"red","size":"small","isFilled":true,"dash":"draw","scale":1},"label":"","labelPoint":[0.5,0.5]},"1324dee1-9f4a-4397-0364-0c760bbb5bd8":{"id":"1324dee1-9f4a-4397-0364-0c760bbb5bd8","type":"triangle","name":"Triangle","parentId":"page","childIndex":3,"point":[68.59,576.85],"size":[354.83,284.8],"rotation":0,"style":{"color":"yellow","size":"small","isFilled":true,"dash":"draw","scale":1},"label":"","labelPoint":[0.5,0.5]},"52fe9b12-d005-4b72-149c-db3937d30da9":{"id":"52fe9b12-d005-4b72-149c-db3937d30da9","type":"group","name":"Group","parentId":"page","childIndex":1,"point":[326.59,129.04],"size":[643.3227311950106,481.14560459498125],"rotation":0,"children":["90f4b27c-610d-4cca-1969-06292a90ce1e","19de3448-7914-41d1-291a-4b28d963d827"],"style":{"color":"black","size":"small","isFilled":false,"dash":"draw","scale":1}}},"bindings":{}}},"pageStates":{"page":{"id":"page","selectedIds":[],"camera":{"point":[661.19,245.07],"zoom":0.5426308719937654}}},"assets":{}},"assets":{}}
alex-kim-dev commented 1 year ago

I tried 2 ways of exporting an svg for the provided file, then imported them in Figma (each pair of vectors are the stroke + background):

  1. select all the figures, right click, export as svg - works fine screenshot_04
  2. clear selection, menu, edit, export as svg - generates an additional rectangle and a circle without a group: screenshot_06