AS3SVGRenderer
AS3SVGRenderer copied to clipboard
Ignore UseElement width, height, x and y if transform is used. Fixes for symbol transformations.
I might not cover all the use cases but it seems that these properties have to be used differently for UseElements or they have to be applied after transform:
The ‘use’ element has optional attributes ‘x’, ‘y’, ‘width’ and ‘height’ which are used to map the graphical contents of the referenced element onto a rectangular region within the current coordinate system. http://www.w3.org/TR/SVG/struct.html#UseElement
The ‘transform’ attribute is applied to an element before processing any other coordinate or length values supplied for that element. In the element http://www.w3.org/TR/SVG/coords.html#TransformAttribute
Hey, do you have an svg example that reproduces that problem? I've just changed a little the positioning of svg use elements, I would like to know if that alone fixes the problem you were experiencing, or if I will have to investigate more your situation.
I experienced that with svg files generated from Illustrator. For an unknown reason Illustrator flips all the contents of symbols vertically, and inverts that using matrix transforms on Use elements. In browser the output looks good but with this library without this fix it all goes crazy. I can provide an example in the next few days if that will still be needed.