[reportlab-users] Bug in renderSVG.SVGCanvas.rect()

Benjamin Wohlwend piquadrat at gmail.com
Tue Oct 30 17:52:28 EDT 2007


while drawing Charts with ReportLab, I stumbled across a little bug in
renderSVG.SVGCanvas.rect(). If the x-coordinate of the first point is bigger
than the second, the width is negative (likewise with y-coordinates).
Negative values are not allowed for these attributes [1]. This happens for
instance when drawing vertical barcharts with negative values.

If my math is right, swapping the coordinates if necessary should solve the
problem. I attached a patch.

Kind regards,

Benjamin Wohlwend

[1] http://www.w3.org/TR/SVG/shapes.html#RectElement
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20071030/523926b5/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: renderSVG.py.patch
Type: text/x-patch
Size: 644 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20071030/523926b5/attachment.bin>

More information about the reportlab-users mailing list