rebootcode / svg-edit

Automatically exported from code.google.com/p/svg-edit
MIT License
0 stars 0 forks source link

identifyLayers may change order of layers if title is missing #776

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an image with two layers. For example:
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg">
 <g>
  <title>Layer 1</title>
  <rect id="svg_1" height="46" width="55" y="156" x="62" fill="#00ff00"/>
 </g>
 <g>
  <title>Layer 2</title>
  <rect id="svg_2" height="50" width="74" y="172" x="84" fill="#007fff"/>
 </g>
</svg>

2. In source edit, remove the title element of the first layer

What is the expected output? What do you see instead?

The former-layer-now-group is added to a new layer which is added after the 
other layer rather than in front, causing the stack order to be incorrect.

Not a terribly likely scenario, but one which needs to be addressed nonetheless.

Original issue reported on code.google.com by adeve...@gmail.com on 4 Feb 2011 at 6:29

GoogleCodeExporter commented 9 years ago
I guess it would help to identify what _should_ happen in this case.

Original comment by codedr...@gmail.com on 8 Feb 2011 at 6:30

GoogleCodeExporter commented 9 years ago
I'd say the newly created layer that holds the former-layer-now-group is added 
before the other layer, so the source order stays intact. The alternative is to 
make all root-level groups into layers whether they have a title or not, but I 
don't think most users would like that.

Original comment by adeve...@gmail.com on 8 Feb 2011 at 6:49