Skip to content

Commit

Permalink
PlayingWidget: Make previous pixmap respect device pixel ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaski committed Mar 28, 2023
1 parent 7b88c19 commit a2533ed
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/widgets/playingwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
Expand Down

0 comments on commit a2533ed

Please sign in to comment.