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

Displaying a gradient in a fill tool #588

Closed
AzamatIshmuratov opened this issue Jun 17, 2021 · 3 comments
Closed

Displaying a gradient in a fill tool #588

AzamatIshmuratov opened this issue Jun 17, 2021 · 3 comments
Labels

Comments

@AzamatIshmuratov
Copy link

I am loading svg with gradient:

image

Сlick on:
image

I get an error in the console:

image

What may be the cause of this problem?

SVG file:
test.txt

@AzamatIshmuratov
Copy link
Author

As I understand it: if the svg element refers to a linear gradient, and this gradient refers to another linear gradient (which has stop tags), then the editor cannot understand

@jfhenon
Copy link
Collaborator

jfhenon commented Aug 30, 2021

This simpler SVG also fails:

<svg width="75" height="75" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
 <metadata id="metadata610">image/svg+xml</metadata>
 <defs id="defs148">
  <linearGradient id="lg2-62" x1="0" x2="0" y1="0" y2="1">
   <stop id="stop21-5" offset="0" stop-color="#3661a0"/>
   <stop id="stop23-1" offset="0.15" stop-color="#6490dc"/>
   <stop id="stop25" offset="0.25" stop-color="#bac8eb"/>
   <stop id="stop27" offset="0.52" stop-color="#4174be"/>
   <stop id="stop29" offset="0.69" stop-color="#3966a9"/>
   <stop id="stop31" offset="0.8" stop-color="#35609f"/>
   <stop id="stop33" offset="0.92" stop-color="#325a96"/>
   <stop id="stop35" offset="1" stop-color="#3b69ad"/>
  </linearGradient>
  <linearGradient id="linearGradient14608" x1="-0.0125" x2="-0.0125" xlink:href="#lg2-62" y1="-0.04045" y2="1.04045"/>
 </defs>
 <g class="layer">
  <title>Layer 1</title>
  <path d="m5.67931,18.33966l0,31.66034l63.32069,-31.66034l0,31.66034l-63.32069,-31.66034z" fill="url(#linearGradient14608)" fill-rule="evenodd" id="shape14-8" stroke="#000000" stroke-width="1.58302"/>
 </g>
</svg>

This seems to be related to the lack of support for href or xlink:href in a gradient.

AgriyaDev5 added a commit to AgriyaDev5/svgedit that referenced this issue Sep 28, 2021
@jfhenon
Copy link
Collaborator

jfhenon commented Sep 28, 2021

fixed

@jfhenon jfhenon closed this as completed Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants