This commit is contained in:
Kovid Goyal 2026-01-31 10:39:29 +05:30
parent 2e0ceacba7
commit aa6b2c9d0a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -747,9 +747,8 @@ class CoverDelegate(QStyledItemDelegate):
cover = QPixmap(cover)
cover.setDevicePixelRatio(painter.device().devicePixelRatioF())
sz = cover.deviceIndependentSize()
cw, ch = sz.width(), sz.height()
dx = max(0, int((rect.width() - cw)/2.0))
dy = max(0, int((rect.height() - ch)/2.0))
dx = max(0, int((rect.width() - sz.width())/2.0))
dy = max(0, int((rect.height() - sz.height())/2.0))
right_adjust = dx
rect.adjust(dx, dy, -dx, -dy)
self.paint_cover(painter, rect, cover)