Skip to content
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

Gradients not parsing when they are not in <defs> group #313

Closed
sroik opened this issue Apr 12, 2018 · 2 comments
Closed

Gradients not parsing when they are not in <defs> group #313

sroik opened this issue Apr 12, 2018 · 2 comments
Milestone

Comments

@sroik
Copy link
Contributor

sroik commented Apr 12, 2018

No description provided.

@ystrot
Copy link
Member

ystrot commented Apr 12, 2018

Do you have a sample?

@sroik
Copy link
Contributor Author

sroik commented Apr 12, 2018

Yes. According to SVG specifications (https://www.w3.org/TR/SVG11/pservers.html), it must be in the defs group.
But Adobe Illustrator saves it, as shown below:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 170 130">
<radialGradient id="radial">
    <stop offset="10%" stop-color="#ffff00"/>
    <stop offset="95%" stop-color="#0000FF"/>
</radialGradient>
<linearGradient gradientUnits="userSpaceOnUse" id="linear" x1="20" x2="120" y1="20" y2="120">
    <stop offset="0" stop-color="#0000FF"/>
    <stop offset="1" stop-color="#ffff00"/>
</linearGradient>
<path d="M 10 10L 100 10L 100 60L 10 60z" fill="url(#radial)"/>
<path d="M 10 70L 100 70L 100 120L 10 120z" fill="url(#linear)"/>
<path d="M 110 10L 160 10L 160 120L 110 120z" fill="url(#radial)"/>
</svg>

@sroik sroik changed the title Gradients parsing when they are not in <defs> Gradients not parsing when they are not in <defs> group Apr 12, 2018
@ystrot ystrot closed this as completed in f5ee8e4 May 16, 2018
ystrot added a commit that referenced this issue May 16, 2018
Fix #313: Gradients not parsing when they are not in <defs> group
@ystrot ystrot added this to the 0.9.2 milestone May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants