mirror of
https://github.com/rbreu/beeref.git
synced 2026-03-11 08:54:28 +00:00
Export scene: Fix size when scene has been scaled/moved (#83)
This commit is contained in:
parent
b95571bce5
commit
dac1da12a4
1 changed files with 4 additions and 5 deletions
|
|
@ -34,11 +34,10 @@ class SceneToPixmapExporter:
|
|||
self.scene.cancel_crop_mode()
|
||||
self.scene.set_selected_all_items(False)
|
||||
# Selection outlines/handles will be rendered to the exported
|
||||
# image, and they also influence the size of the sceneRect.
|
||||
# So deselect first.
|
||||
size = self.scene.sceneRect().size()
|
||||
if isinstance(size, QtCore.QSizeF):
|
||||
size = size.toSize()
|
||||
# image, so deselect first. (Alternatively, pass an attribute
|
||||
# to paint functions to not paint them?)
|
||||
rect = scene.itemsBoundingRect()
|
||||
size = QtCore.QSize(int(rect.width()), int(rect.height()))
|
||||
self.margin = max(size.width(), size.height()) * 0.03
|
||||
self.default_size = size.grownBy(
|
||||
QtCore.QMargins(*([int(self.margin)] * 4)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue