mchoe / SwiftSVG

A simple, performant, and lightweight SVG parser
Other
1.94k stars 229 forks source link

Element style overriding error #98

Open buguibu opened 6 years ago

buguibu commented 6 years ago

I have a SVG element that in it's own attribute style override a fillColor defined by css id rule, but the interpreter seems to not properly process it and apple the id defined color.

<g id="groupd_id" style="stroke: #BFB6A4;stroke-width: 1;fill: #F1EDE6;">
<path d="M 757.1187 261.5817 8...." id="path_id" style="fill: #FF6F3A;"/></g>

As the path firstly receive the color from the group_id style definition the library doesn´t seems to apply it´s own style definition.

(Related issue https://github.com/mchoe/SwiftSVG/issues/96)

Gujci commented 5 years ago

As far as I found out only the info in path matters. I had a fill-rule attribute in style, but it got ignored. Since style is basically plain text, I don't know wether it is trivial to implement to this lib or not.