memononen / nanosvg

Simple stupid SVG parser
zlib License
1.71k stars 363 forks source link

Parse <svg> percentage width for automatic sizing #116

Closed porglezomp closed 6 years ago

porglezomp commented 6 years ago

Instead of calculating percentage coordinates relative to 1px, we calculate them relative to 0px width, that way an explicit will be converted to and trigger the bounding-box sizing calculation.

memononen commented 6 years ago

Thanks for the fix

memononen commented 6 years ago

I merged your fix. It's a little subtle, but correct behavior.