Skip to content

Commit

Permalink
Merge pull request pyqtgraph#718 from ales-erjavec/svg-export-exposed…
Browse files Browse the repository at this point in the history
…-rect

SVGExport: Initialize option.exposedRect for items that use it
  • Loading branch information
campagnola authored Jul 10, 2018
2 parents c3f612d + 5695047 commit ada79bf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyqtgraph/exporters/SVGExporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ada79bf

Please sign in to comment.