1

I have an SVG with grouped elements like so:

<g id="group_id" transform="translate(-10,-10)">
  <rect y="50" x="50" height="20" width="20" id="rect_id"/>
  <ellipse cy="70" cx="70" ry="10" rx="10" id="ellipse_id"/>
</g>

Using Inkscape I want to get rid of the transform attribute of the group (<g>) and apply the translation to the subelements (<rect> and <ellipse>), while keeping them grouped.

The result should in principle look like this:

<g id="group_id">
  <rect y="40" x="40" height="20" width="20" id="rect_id"/>
  <ellipse cy="60" cx="60" ry="10" rx="10" id="ellipse_id"/>
</g>

Existing answers suggest ungrouping and regrouping (CTRL-U, CTRL-D), which works fine but changes the IDs of the elements and the group.

What I want is the IDs (group_id, rect_id and ellipse_id) of all elements to be kept.

Alexander Presber
  • 6,429
  • 2
  • 37
  • 66
  • 1
    Open Edit->XML editor (Shift-Ctrl+x), copy transform attribute value from group, delete attribute from group, set transform attribute for each child pasting the value. – ccprog Jan 08 '19 at 15:19
  • What he said. Or in any text editor really. – Ted Jan 08 '19 at 15:33
  • @ccprog Thanks, but I would like the transformations to be **applied** to the sub-elements (made that more obvious in my question). Also I wonder whether there is no simpler solution than manually editing attributes? – Alexander Presber Jan 09 '19 at 12:46
  • 1
    Possible duplicate of [Removing transforms in SVG files](https://stackoverflow.com/questions/13329125/removing-transforms-in-svg-files) Going through the answers, tere are realy a lot of good ideas there. – ccprog Jan 09 '19 at 16:01

0 Answers0