From a2533edd57b273aefa54f27e26c28d97f2256886 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Wed, 29 Mar 2023 00:24:38 +0200 Subject: [PATCH] PlayingWidget: Make previous pixmap respect device pixel ratio --- src/widgets/playingwidget.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/widgets/playingwidget.cpp b/src/widgets/playingwidget.cpp index 388fa1a1e..6f622d143 100644 --- a/src/widgets/playingwidget.cpp +++ b/src/widgets/playingwidget.cpp @@ -303,9 +303,16 @@ void PlayingWidget::SetImage(const QImage &image) { if (enabled_ && visible_ && active_) { // Cache the current pixmap so we can fade between them - QSize psize(size()); - if (size().height() <= 0) psize.setHeight(total_height_); + QSize psize; + psize.setWidth(size().width() * devicePixelRatioF()); + if (size().height() > 0) { + psize.setHeight(size().height() * devicePixelRatioF()); + } + else { + psize.setHeight(total_height_ * devicePixelRatioF()); + } pixmap_previous_track_ = QPixmap(psize); + pixmap_previous_track_.setDevicePixelRatio(devicePixelRatioF()); pixmap_previous_track_.fill(palette().window().color()); pixmap_previous_track_opacity_ = 1.0; QPainter p(&pixmap_previous_track_);