mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
Cover grid: Vertically center covers that are smaller than the available space. Fixes #1886731 [Enhancement request: Vertically centering images in book grid](https://bugs.launchpad.net/calibre/+bug/1886731)
This commit is contained in:
parent
c52574c4d9
commit
23db78d486
1 changed files with 2 additions and 2 deletions
|
|
@ -565,9 +565,9 @@ def paint(self, painter, option, index):
|
|||
dpr = cdata.devicePixelRatio()
|
||||
cw, ch = int(cdata.width() / dpr), int(cdata.height() / dpr)
|
||||
dx = max(0, int((rect.width() - cw)/2.0))
|
||||
dy = max(0, rect.height() - ch)
|
||||
dy = max(0, int((rect.height() - ch)/2.0))
|
||||
right_adjust = dx
|
||||
rect.adjust(dx, dy, -dx, 0)
|
||||
rect.adjust(dx, dy, -dx, -dy)
|
||||
painter.drawPixmap(rect, cdata)
|
||||
if self.title_height != 0:
|
||||
self.paint_title(painter, trect, db, book_id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue