[reportlab-users] renderSVG bug

Robin Becker reportlab-users@reportlab.com
Mon, 14 Oct 2002 08:58:53 +0100


In article <22215.1034571082@www43.gmx.net>, Eric Johnson <eggsy@gmx.de>
writes
>There appears to be a bug in the renderSVG code that handles paths. 
>The problem arises in the _fillAndStroke method when used with a path that 
>is not 
>closed.  The problem appears to be that the renderer does uses the default 
>fill 
>in this case rather than setting "fill: none" 
> 
>A simple fix for this is to add the following line as the first line in 
>the 
>_fillAndStroke method in renderSVG.py. 
>        self.setFillColor(self._fillColor) 
> 
>It may be more elegant to use the applyStateChange method. 
> 
>Attached is a simple example illustrating the bug. 
> 
>Eric 
>  
>
I'm not the expert here as Dinu wrote this module, but I would expect
that _fillAndStroke would do exactly that and given that there are
default fill and stroke colours those would then be used.

I think the real problem here is what constitutes a 'closed' path. I
know that renderPM has to be fairly explicit about closing a path,
perhaps SVG is more forgiving.
-- 
Robin Becker