From ccd039b1a7479669858217c16385f0cbb22ed6f0 Mon Sep 17 00:00:00 2001 From: Be Date: Wed, 23 Oct 2019 22:13:28 -0500 Subject: [PATCH] CoverArtDelegate: compare numbers in appropriate scale pixmap's dimensions are in real pixels, option.rect is device-independent pixels --- src/library/coverartdelegate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/library/coverartdelegate.cpp b/src/library/coverartdelegate.cpp index 7d032dac28d8..12f3394a5f86 100644 --- a/src/library/coverartdelegate.cpp +++ b/src/library/coverartdelegate.cpp @@ -114,8 +114,8 @@ void CoverArtDelegate::paintItem(QPainter *painter, m_bOnlyCachedCover, true); pixmap.setDevicePixelRatio(scaleFactor); if (!pixmap.isNull()) { - int width = math_min(pixmap.width(), option.rect.width()) * scaleFactor; - int height = math_min(pixmap.height(), option.rect.height()) * scaleFactor; + int width = math_min(static_cast(pixmap.width()), option.rect.width() * scaleFactor); + int height = math_min(static_cast(pixmap.height()), option.rect.height() * scaleFactor); QRect target(option.rect.x(), option.rect.y(), width, height); QRect source(0, 0, target.width() * scaleFactor, target.height() * scaleFactor); painter->drawPixmap(target, pixmap, source);