mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix placement of overly large ImageBlocks
This commit is contained in:
parent
2adf7f1d13
commit
5a21453397
@ -644,6 +644,13 @@ class _Canvas(QGraphicsRectItem):
|
|||||||
self.is_full = True
|
self.is_full = True
|
||||||
else:
|
else:
|
||||||
br = ib.boundingRect()
|
br = ib.boundingRect()
|
||||||
|
max_height = min(br.height(), self.max_y-y)
|
||||||
|
max_width = min(br.width(), self.max_x-x)
|
||||||
|
if br.height() > max_height or br.width() > max_width:
|
||||||
|
p = ib.pixmap()
|
||||||
|
ib.setPixmap(p.scaled(max_width, max_height, Qt.IgnoreAspectRatio,
|
||||||
|
Qt.SmoothTransformation))
|
||||||
|
br = ib.boundingRect()
|
||||||
ib.setParentItem(self)
|
ib.setParentItem(self)
|
||||||
ib.setPos(x, y)
|
ib.setPos(x, y)
|
||||||
self.current_y = y + br.height()
|
self.current_y = y + br.height()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user