xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thierry Kormann" <tkorm...@ilog.fr>
Subject FW: BUG in FillShapePainter (batik)
Date Tue, 01 Jun 2004 09:22:55 GMT
 


  _____  

From: Roberto Pellagatti [mailto:roberto.pellagatti@ropel.it] 
Sent: Tuesday, June 01, 2004 9:36 AM
To: Thierry.Kormann@sophia.inria.fr
Subject: BUG in FillShapePainter (batik)


Hello Thierry,
I've found the cause of a strange behaviour in Batik:
with the following code 

<?xml version="1.0" encoding="UTF-8"?>
<svg>
<line x1="70" y1="422" x2="270" y2="129" stroke-width="4" stroke="#0000ff"
stroke-dasharray="10,20"/>
</svg>

I get a big dashed line with a thin black line through the white spaces:
this black line is very annoying, specially with dashed lines with a width
of 1 or 2 (the line covers the dashing);
I create a PDF with the command
java -jar batik-1.5.1/batik-rasterizer.jar -m application/pdf -bg
255.255.255.255 myfile.svg


I've discovered that commenting out the fill instruction in
FillShapePainter.java 
(line 108, sources from version 1.5.1, @version $Id: FillShapePainter.java,v
1.14 2003/10/23 01:01:55 deweese Exp $ ) 
the thin line disappears.

     public void paint(Graphics2D g2d) {
        if (paint != null) {
            g2d.setPaint(paint);
---->       g2d.fill(shape);
        }
    }

Of course this is not a valid solution (this fill is surely needed in other
contests) but I hope it helps finding the right one.

I've also found that changing the SVG code 
<line x1="70" y1="422" x2="270" y2="129" stroke-width="4" stroke="#0000ff"
stroke-dasharray="10,20"/>
adding   fill="white" 
helps making the fill invisible (on white backgrounds).

Regards
Roberto Pellagatti
Milano



Mime
View raw message