flamingo-svg-transcoder
flamingo-svg-transcoder copied to clipboard
Incomplete transformation
when I transform the following svg, the path p2 does not show up in the java icon.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="300" height="300" id="svg2" version="1.1">
<defs id="defs4">
<linearGradient id="lg1">
<stop id="s1" offset="0" style="stop-color:white;stop-opacity:0;"/>
<stop id="s2" offset="1" style="stop-color:white"/>
</linearGradient>
<linearGradient xlink:href="#lg1" id="lg3" x1="191" y1="156" x2="148" y2="10" gradientUnits="userSpaceOnUse"/>
<linearGradient id="lg2">
<stop style="stop-color:#D5FFD5;stop-opacity:1;" offset="0" id="s3"/>
<stop style="stop-color:#80FF80;stop-opacity:1;" offset="0.36" id="s4"/>
<stop style="stop-color:#2AFF2A;stop-opacity:1;" offset="0.79" id="s5"/>
<stop style="stop-color:#00FF00;stop-opacity:1;" offset="1" id="s6"/>
</linearGradient>
<radialGradient xlink:href="#lg2" id="rg1" cx="-100" cy="-278" fx="-100" fy="-278" r="155" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.267,0,0,1.73,26.67,204.12)"/>
</defs>
<g id="layer1" transform="translate(255,539)">
<path style="stroke:#00D400;fill:url(#rg1);stroke-width:4" id="p1" d="M 54 -394 A 154 154 0 1 1 -254,-394 A 154 154 0 1 1 54 -394 z" transform="matrix(0.949753,0,0,0.949753,-10.31027,-14.52566)"/>
<path style="fill:url(#lg3)" d="M 150,10 C 74,10 12,71 10,147 C 49,182 87,183 106,174 C 126,165 142,136 168,129 C 194,123 208,124 249,141 C 272,150 269,119 286,116 C 271,55 216,10 150,10 z " transform="translate(-255,-539)" id="p2"/>
</g>
</svg>
Thank you for the report Matthias, I'll look into it. The shape for the path p2 is properly transcoded to Java, but I suspect the gradient definition is not. You can try to tinker the colors on the line with g.setPaint(new LinearGradientPaint(...)) and see if it works better.
Hi Emmanuel, this was my first guess and I tried with Color.black. It does not work. The key is the tranform translate(255,539). If I comment out line 118 of the generated code the icon is rendered corrently.