xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Teck Hua Lee <gteck...@gmail.com>
Subject Re: Line element does not render with gradient stroke
Date Thu, 08 Apr 2010 19:19:45 GMT
Sorry, this is the correct example which is a simplified version of
http://www.w3.org/Graphics/SVG/Test/20061213/svggen/pservers-grad-17-b.svg.

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="
http://www.w3.org/1999/xlink" version="1.1">
<defs>
<linearGradient id="grad">
<stop offset="0" stop-color="black" />
<stop offset="1" stop-color="white" />
</linearGradient>
</defs>
  <line id="line1" x1="0" y1="180" x2="480" y2="180" stroke="green"
stroke-width="20"/>
<line id="line2" x1="0" y1="180" x2="480" y2="180" stroke="url(#grad)"
stroke-width="20" transform="rotate(90, 240, 180)"/>
</svg>

On Thu, Apr 8, 2010 at 3:00 PM, Teck Hua Lee <gteckhua@gmail.com> wrote:

> When using the PNGTranscoder (1.7 and trunk), I noticed that lines with
> gradient strokes will not render.
>
> In the example below "line2" will not be drawn.
>
> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="
> http://www.w3.org/1999/xlink" version="1.1">
>  <defs>
> <linearGradient id="grad">
> <stop offset="0" stop-color="black" />
>  <stop offset="1" stop-color="white" />
> </linearGradient>
>  </defs>
>   <line id="line1" x1="0" y1="180" x2="480" y2="180" stroke="green"
> stroke-width="20"/>
>   <line id="line2" x1="410" y1="10" x2="70" y2="350" stroke="url(#grad)"
> stroke-width="20"/>
> </svg>
>
> I tracked this down to SVGLinearGradientElementBridge.buildGradient:128
> where the code returns a null Paint because the line's width is 0px.
> However, shouldn't the code be checking the stroke-width instead? (20px)
>
> This example is based on the following W3C SVG spec test file which renders
> correctly in Firefox and Chrome.
> http://www.w3.org/Graphics/SVG/Test/20061213/svggen/pservers-grad-17-b.svg
>
> Is this a known issue or should I file a bug?
>

Mime
View raw message