crccheck / raphael-svg-import-classic

Import SVG files to Raphael
MIT License
98 stars 40 forks source link

Use SVG defaults for stroke-width, fill and stroke attributes #17

Closed wpiekutowski closed 10 years ago

wpiekutowski commented 10 years ago

First of all, thank you for this great piece of code!

I had a small issue with the default value of stroke-width set to 0. According to http://www.w3.org/TR/SVG/painting.html it should default to 1, but was 0 because of some old bug in Chrome (at least that what I could understand from git log). With the default setting all tests pass and visuals match too, at least in FF and Chromium. Alternatively, I'd consider removing these default altogether, but maybe that's a good idea to force them in all browsers.

crccheck commented 10 years ago

Thanks, this looks simple so I can check it out soon. I think we can't remove it because Raphael has a default style that's different from svg's default.

wpiekutowski commented 10 years ago

Thanks for a prompt response. It seems that at least Raphael's default for stroke-width is the same as in SVG spec: http://raphaeljs.com/reference.html#Element.attr (search for stroke-width) Also git grep stroke-width inside Raphael's source indicates many places where 1 is used as a default.

The other thing is that this project is about importing SVG files, so by sticking to SVG defaults the resulting Raphael code should better match the source.

On 7 February 2014 22:00, crccheck notifications@github.com wrote:

Thanks, this looks simple so I can check it out soon. I think we can't remove it because Raphael has a default style that's different from svg's default.

— Reply to this email directly or view it on GitHubhttps://github.com/crccheck/raphael-svg-import-classic/pull/17#issuecomment-34502358 .