On Wed, 2 Feb 2011 10:54:57 +0000 Peter Hull <peterhul...@gmail.com> wrote:
> I noticed that Batik will crop the edges of thick stroke lines so for > example <?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 width="256px" height="256px" version="1.1" viewBox="0 0 256 256" > xmlns="http://www.w3.org/2000/svg" > xmlns:xlink="http://www.w3.org/1999/xlink" > > <symbol id="rc"> > <rect x="0" y="0" width="20" height="100" stroke="black" > stroke-width="10" fill="white" /> > </symbol> > <use xlink:href="#rc" x="100" y="100" /> > </svg> > will show a rect with apparently a thinner stroke on the top/left > because it was cropped at x=0 and y=0, even though the final shape is > rendered in the middle of the page. > > Just for my information, is that to do with Batik's implementation or > is it in the SVG spec (I couldn't find the relevant section) > Thanks, > Peter The cause of your symptom is probably the overflow attribute (which is defaulted on svg in this case). From the SVG 1.1 spec, section 14.3.3: "When an outermost svg element is stand-alone or embedded inline within a parent XML grammar which does not use CSS layout or XSL formatting, the ‘overflow’ property on the outermost svg element is ignored for the purposes of visual rendering and the initial clipping path is set to the bounds of the initial viewport." So basically, the image is clipped at x=0 and y=0. Since the rectangle has a stroke-width of 10 and starts at 0,0, the top and left edges should be about half as thick. Since the stroke is centered on the coordinates you give. It sort of makes sense, once you've seen it in action. G. Wade -- Understanding is a three-edged sword. -- Kosh in "Deathwalker" --------------------------------------------------------------------- To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org