Currently, NanoSVG will miss those tags as they're not yet available at the time <g> is parsed (i.e. the shapes needing those gradient will not be painted). This PR fixes this by relaying the resolution of gradient names to a point when the whole XML has been parsed.
Rendering without PR (background not part of NanoSVG rendering):
Rendering with PR (background not part of NanoSVG rendering):
Some SVGs (like the ones exported from Affinity Designer) have their
<defs>
tags after their<g>
tags. Example file:gradient-circles.svg.zip
Currently, NanoSVG will miss those tags as they're not yet available at the time
<g>
is parsed (i.e. the shapes needing those gradient will not be painted). This PR fixes this by relaying the resolution of gradient names to a point when the whole XML has been parsed.Rendering without PR (background not part of NanoSVG rendering):
Rendering with PR (background not part of NanoSVG rendering):