chenbo007 / svg-edit

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

Ensure unused gradients are removed when serializing SVG #85

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
SVG-edit currently creates a linearGradient as soon as the Fill/Stroke
dialog is closed (even if no element references it).  We need some JS to
find all unreferenced gradients and simply remove them from the DOM.

Original issue reported on code.google.com by codedr...@gmail.com on 8 Aug 2009 at 11:01

GoogleCodeExporter commented 9 years ago

Original comment by adeve...@gmail.com on 19 Aug 2009 at 2:20

GoogleCodeExporter commented 9 years ago
Thanks for starting this Alexis - presumably this only needs to be done upon
serialization.

Original comment by codedr...@gmail.com on 19 Aug 2009 at 2:28

GoogleCodeExporter commented 9 years ago
Also took care of this TODO for setFillPaint:

"TODO: rework this so that we are not append elements into the SVG at this stage
This should only be done at the actual creation stage or when we change a 
selected 
element's fill paint - at that point, batch up the creation of the gradient 
element
with the creation/change"

So now the gradient element is only added when an element is created that needs 
it.

Original comment by adeve...@gmail.com on 19 Aug 2009 at 5:12

GoogleCodeExporter commented 9 years ago

Original comment by codedr...@gmail.com on 20 Aug 2009 at 8:58