Merge pull request #718 from ales-erjavec/svg-export-exposed-rect

SVGExport: Initialize option.exposedRect for items that use it
This commit is contained in:
Luke Campagnola 2018-07-10 15:44:27 -07:00 committed by GitHub
commit ada79bffde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.