sammycage / lunasvg

SVG rendering and manipulation library in C++
MIT License
866 stars 124 forks source link

Rendering issues/regressions (fill/pattern) ? #118

Closed poire-z closed 1 year ago

poire-z commented 1 year ago

Upgraded from 637121f8 to your latest master, and I notice some rendering issues of stuff related to fill or pattern (I have no tool to inspect/isolate stuff in these complex SVGs, so sharing them and what I see, hope it's ok). These issues were not there when I use your latest August commits. I see nothing obvious that could cause this in your lunasvg/source/ changes (except possibly the CSS parsing refactoring that I did not get familiar with), so it may be stuff on the 3rdparty/plutovg side.

These are images from https://commons.wikimedia.org/wiki/User:JoKalliauer/SVG_test_suites/resvg_Issues_details, and the only 4 of themwhere I noticed some issues. (These SVGs on this page are supposed to be problematic ones, causing issues with various renderers, so it might be ok if you fixed stuff to be more conforming to not have them working anymore :) In my screenshots, left is with your August code, right is with current master.


20 Feedbin-Favicon-tag A single path, no viewbox/width/height. Now it does not render anything: image


22 Coa_Frankfurt-H%C3%B6chst_Test

I think this one has patterns in the big red areas, and the patterns rendering was already a bit variable previously (when zooming/rerendering, possibly just some scaling/aliasing artifacts). But now, it's mostly white with some pieces missing. Moreover, when you zoom, bits appear or disappear, stuff get filled or unfilled. It feels there may be stuff uninitialized. image


31 Manfeild_Autocourse_track_map_%28New_Zealand%29_TextOnPath_converted_to_Path The thing circled in yellow loses its pattern. Also, when zooming its filling color (which was absent in the previous result) varies from black to gray to white. image


52 Grundriss_Burg_Hageneck The gray/hatched pattern are missing: image

and when zooming/rerendering, I may get this from time to time: image


Thanks again for this nice library and your recent fixes :)

sammycage commented 1 year ago

Fixed in commit 56ddf2a5a1353d8ec5bddaee08a89a7be60a86e0

poire-z commented 1 year ago

Thank you ! I can confirm the 3 last issues above are fixed. The first one might be my issue (SVG in a HTML context) as it displays ok (icon displayed, and image size fitting the icon) when zooming on it.