-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support xlink:href for defs #68
Comments
I don't have support for these kind of composed references for |
Renamed this issue and will leave open to track/gauge interest. |
@dnfield Please forgive my ignorance w/ SVG's and what not. But isn't a gradient what I'm referencing? And fearing lack of support I tried some of the other SVG's this app uses. And this one works fine, which has similar stuff going on like the weird xlink:href thing. This works:
I don't get why this works and the other doesn't. |
But regardless, is a gradient like I'm wanting (linear inside a cirlce) possible and I just need to change my svg's xml, or are you saying that's not supported? |
So it does work if I remove the xlink:
Still not super great w/ SVG's but this works. Perhaps I just am not noticing a difference rendering the other SVG through your library that may well be manifesting. |
It looks like neither is working to my eyes - it's just that your second example it's less obvious because of the size of the paths. Your first SVG could be refactored like this, and it will work fine: <svg viewBox="0 0 32 32">
<defs>
<linearGradient id="linearGradient4688">
<stop stop-color="#761f24" offset="0"/>
<stop stop-color="#962025" stop-opacity="0.35" offset="0.65"/>
<stop stop-color="#c1272d" stop-opacity="0" offset="1"/>
</linearGradient>
<linearGradient y2="0" x2="0" y1="1" x1="0.5" id="linearGradient4694">
<stop stop-color="#761f24" offset="0"/>
<stop stop-color="#962025" stop-opacity="0.35" offset="0.65"/>
<stop stop-color="#c1272d" stop-opacity="0" offset="1"/>
</linearGradient>
</defs>
<circle fill="#c1272d" stroke="#b8cfe0" stroke-width="1.5" stroke-linejoin="round" stroke-miterlimit="4" r="15.25" cy="16" cx="16"/>
<circle fill="url(#linearGradient4694)" stroke-miterlimit="4" r="12" cx="16" cy="16"/>
</svg> In fact, you could remove the Your second one could also be refactored similarly. Basically, the |
Implemented in dd44ee7 Still needs:
|
I'd appreciate any feedback on whether this is really fixing the problem for all your SVGs - I added a couple tests that pass, but suspect I might be missing something for some more complicated cases. |
This should be working as of v0.10.1 Going to open another issue for out of order def support, which Inkscape seems to also like to do. |
Here's the SVG:
Renders fine in chrome with a red angled linear gradient in the center part caused by the inner circle.
In my app, the inner circle is plain white. Any idea why?
The text was updated successfully, but these errors were encountered: