From 56950479f9eee3c9685cfb565b34c34225bd6ae8 Mon Sep 17 00:00:00 2001 From: Ales Erjavec Date: Fri, 6 Jul 2018 15:53:28 +0200 Subject: [PATCH] SVGExport: Initialize option.exposedRect for items that use it --- pyqtgraph/exporters/SVGExporter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyqtgraph/exporters/SVGExporter.py b/pyqtgraph/exporters/SVGExporter.py index b1569b74..dcd95c2b 100644 --- a/pyqtgraph/exporters/SVGExporter.py +++ b/pyqtgraph/exporters/SVGExporter.py @@ -180,7 +180,10 @@ def _generateItemSvg(item, nodes=None, root=None, options={}): item.setExportMode(True, {'painter': p}) try: p.setTransform(tr) - item.paint(p, QtGui.QStyleOptionGraphicsItem(), None) + opt = QtGui.QStyleOptionGraphicsItem() + if item.flags() & QtGui.QGraphicsItem.ItemUsesExtendedStyleOption: + opt.exposedRect = item.boundingRect() + item.paint(p, opt, None) finally: p.end() ## Can't do this here--we need to wait until all children have painted as well.