From [email protected] on May 27, 2010 13:10:30
When I try to render this SVG using canvg: http://blog.visucore.com/files/svg/led.svg The outer (glow) radial gradient is rendered wrongly. For some reason it is
completely off-center or mis-scaled (haven't found out what yet) causing
the entire circle to be rendered as transparent.
Output:
save();
font = ' 10px sans-serif';
beginPath();
moveTo(0,0);
lineTo(41.03125,0);
lineTo(41.03125,35.6875);
lineTo(0,35.6875);
closePath();
clip();
strokeStyle = 'rgba(0,0,0,0)';
lineCap = 'butt';
lineJoin = 'miter';
miterLimit = 4;
save();
restore();
save();
restore();
save();
translate(-0.392821,0.0710407);
save();
g1 = createRadialGradient(55.375847,43.243359,0,55.375847,43.243359,15.8125);
g1.addColorStop(0,'rgba(99, 251, 0, 1)');
g1.addColorStop(0.53061223,'rgba(90, 229, 0, 1)');
g1.addColorStop(1,'rgba(20, 20, 20, 0)');
fillStyle = g1;
strokeStyle = 'rgba(0,0,0,0)';
beginPath();
moveTo(20.924071,-0.07104075);
bezierCurveTo(10.494467000000002,-0.07104075,0.39282109000000176,6.9836782,0.39282109000000176,17.772709);
bezierCurveTo(0.39282109000000176,28.56174,10.494467000000002,35.616459,20.924071,35.616459);
bezierCurveTo(31.353675000000003,35.616459,41.424071,28.535198,41.424071,17.772709);
bezierCurveTo(41.424071,7.010220199999999,31.353674999999996,-0.07104075000000165,20.924070999999998,-0.07104075000000165);
closePath();
fill();
stroke();
restore();
save();
g2 = createRadialGradient(115.70896,153.41667,0,115.70896,153.41667,16.75);
g2.addColorStop(0,'rgba(187, 241, 93, 1)');
g2.addColorStop(0.54348761,'rgba(162, 229, 35, 1)');
g2.addColorStop(1,'rgba(141, 231, 51, 1)');
fillStyle = g2;
strokeStyle = 'rgba(0,0,0,0)';
beginPath();
moveTo(34.054677,17.783455);
bezierCurveTo(34.054677,23.563064,28.170692,28.248365,20.912428999999996,28.248365);
bezierCurveTo(13.654165999999996,28.248365,7.770181099999997,23.563064,7.770181099999997,17.783455);
bezierCurveTo(7.770181099999997,12.003846,13.654165999999996,7.3185442,20.912428999999996,7.3185442);
bezierCurveTo(28.170691999999995,7.3185442,34.054677,12.003846,34.054677,17.783455);
closePath();
fill();
stroke();
restore();
save();
g3 = createRadialGradient(122.75,144.76639,0,122.75,144.76639,16.75);
g3.addColorStop(0,'rgba(255, 255, 255, 1)');
g3.addColorStop(1,'rgba(255, 255, 255, 0)');
fillStyle = g3;
strokeStyle = 'rgba(0,0,0,0)';
transform(0.684752,0,0,0.616201,-55.4553,-79.7338);
beginPath();
moveTo(129,155.75);
bezierCurveTo(129,162.51549,122.84392,168,115.25,168);
bezierCurveTo(107.65608,168,101.5,162.51549,101.5,155.75);
bezierCurveTo(101.5,148.98451,107.65608,143.5,115.25,143.5);
bezierCurveTo(122.84392,143.5,129,148.98451,129,155.75);
closePath();
fill();
stroke();
restore();
restore();
restore();
Attachment: led.svg
Original issue: http://code.google.com/p/canvg/issues/detail?id=48