question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LinearGradientBrush trouble (2)

See original GitHub issue

I have found in https://commons.wikimedia.org/wiki/Tango_icons fragment of icon with linear gradient trouble in SharpVectors. This is hard core sample:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="32px"
   height="32px"
   id="svg2"
   sodipodi:version="0.32"
   inkscape:version="0.92.3 (2405546, 2018-03-11)"
   version="1.0"
   sodipodi:docname="Test2.svg"
   inkscape:export-filename="/home/lapo/Desktop/per jimmac/scalable/devices/battery.png"
   inkscape:export-xdpi="90"
   inkscape:export-ydpi="90"
   inkscape:output_extension="org.inkscape.output.svg.inkscape">
  <defs
     id="defs4">
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StrokeGradient"
       id="linearGradient3339-5"
       gradientUnits="userSpaceOnUse"
       x1="15.518289"
       y1="35.925144"
       x2="17.391279"
       y2="41.137268" />
    <linearGradient
       inkscape:collect="always"
       id="StrokeGradient">
      <stop
         style="stop-color:#d11111;stop-opacity:1"
         offset="0"
         id="stop7479-7" />
      <stop
         style="stop-color:#7abe03;stop-opacity:1"
         offset="1"
         id="stop7481-6" />
    </linearGradient>
  </defs>
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="32"
     inkscape:cx="23.422064"
     inkscape:cy="18.0022"
     inkscape:document-units="px"
     inkscape:current-layer="layer5"
     showgrid="true"
     inkscape:window-width="1920"
     inkscape:window-height="1017"
     inkscape:window-x="-8"
     inkscape:window-y="-8"
     stroke="#c4a000"
     inkscape:grid-points="false"
     inkscape:grid-bbox="true"
     fill="#555753"
     showborder="true"
     inkscape:showpageshadow="false"
     inkscape:window-maximized="1"
     inkscape:snap-global="false">    
  </sodipodi:namedview>
  <g
     inkscape:groupmode="layer"
     id="layer5"
     inkscape:label="Icon"
     style="display:inline"
     transform="translate(0,-16)">
    <ellipse
       id="path7459-3"
       style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient3339-5);stroke-width:1.24232507;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
       cx="16.175068"
       cy="38.542446"
       rx="7.8665628"
       ry="4.8613591"
       transform="matrix(1.2076429,0,0,0.53652634,-3.5337049,9.6498437)" />
  </g>
</svg>

lineargradienttrouble2

I have tested 3 different SVG parsers - all of them failed on this sample. I think it cos of this transformations:

<g
     inkscape:groupmode="layer"
     id="layer5"
     inkscape:label="Icon"
     style="display:inline"
     transform="translate(0,-16)">  <=====
    <ellipse
       id="path7459-3"
       style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient3339-5);stroke-width:1.24232507;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
       cx="16.175068"
       cy="38.542446"
       rx="7.8665628"
       ry="4.8613591"
       transform="matrix(1.2076429,0,0,0.53652634,-3.5337049,9.6498437)" /> <======
  </g>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Kozinakacommented, Nov 13, 2018

If it would be possible I wish have a quick edit mode to snap parts of icon for each size version. Like a small specialized Inkscape for snapping: move nodes, change thickness, snapping, quick preview for result.

1reaction
paulushubcommented, Nov 9, 2018

Thank you, preparing version 1.2 for release by Monday.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Weird behavior of LinearGradientBrush
Problem is the bug in MS implementation of Fill(): When you think you take brush and apply at some point (X,Y), MS works...
Read more >
transparency doesn't work on 2 objects - Microsoft Q&A
I have 2 problems: box1 overlaps box2 though transparency has been applied. When clicking on the object behind, the color of the object...
Read more >
#213 – Changing the Gradient Line in a Linear Gradient Brush ...
You can change the gradient line by specifying values for the StartPoint and EndPoint properties. Each of these properties specifies a two- ...
Read more >
Gradient colors disappear in PDF file
Solved: I have a yellow gradient on an Illustrator CC project. When I save it as a PDF file the color is not...
Read more >
Figma Tutorial: Gradients (Linear, Radial, Angular, Diamond)
... 0:25 - Linear gradients 1:26 - Radial gradients 1:40 - Angular gradients 1:50 - Diamond gradients 2 :04 - The four gradient...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found