memononen / nanosvg

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

fix shapes order #82

Closed lieff closed 7 years ago

lieff commented 7 years ago

I`m tried this optimization https://github.com/memononen/nanosvg/pull/81 and have garbled image on complex svg which requires correct draw order (like tiger.svg). So, I rewrite it to tail caching and it works for me.

lieff commented 7 years ago

Fixed. NULL == p->image->shapes is for reliability, NULL = p->image->shapes typo wont compile. But its less human readable.

memononen commented 7 years ago

Thanks for the fix!

I'm familiar with the type of comparison as you wrote, and I agree with it's benefits. It's just not with the style of the rest of the code.