[reportlab-users] svg rendering and groups

Marcel Tromp marcel_reportlab at tromp.org
Sun Oct 5 04:13:54 EDT 2008


Problem is that renderSVG assumes additive transforms while RL assumes
absolute transforms for groups in groups.

The patch below solves the problem. It surpresses transforms for group
elements.

Marcel
--

--- renderSVG.py 2008-10-04 22:37:44.791828000 -0700
+++
/lib/python2.5/site-packages/reportlab/graphics/renderSVG.py
2008-06-30 20:47:27.069418000 -0700
@@ -661,19 +661,10 @@
node2 = childNode.provideNode()
else:
node2 = childNode
- if isinstance(node2, Group) == False:
- self.drawNode(node2)
+ self.drawNode(node2)
self._canvas.transform(a, b, c, d, e, f)
self._canvas.endGroup(currGroup)

- for childNode in group.getContents():
- if isinstance(childNode, UserNode):
- node2 = childNode.provideNode()
- else:
- node2 = childNode
- if isinstance(node2, Group):
- self.drawNode(node2)
-
if self.verbose: print "### end _SVGRenderer.drawGroup"



Andy Robinson wrote:

> 2008/10/2 Dinu Gherman <gherman at darwin.in-berlin.de>:

>> I was involved in writing ReportLab's renderSVG module (Robin,

>> correct me, if I'm wrong), but I am no longer and I don't know

>> how much RL supports or even uses this code nowadays.

>

> Nobody here actually looks closely at the output.

>

> We'd welcome both specific error messages and patches; I can be

> certain they won't break any RL applications as we don't use SVG

> at all.

>

> - Andy

> _______________________________________________

> reportlab-users mailing list

> reportlab-users at reportlab.com

> http://two.pairlist.net/mailman/listinfo/reportlab-users




More information about the reportlab-users mailing list