plugins/startupfeedback: Fix bouncing icon being too small on wayland

We need to be careful about the target rect when painting a hidpi image
onto a lodpi image.

This is the case when the startup feedback generates bouncing frames.
The icon pixmap may be hidpi, while the result image has device pixel
ratio 1.
wilder/Plasma/6.2
Vlad Zahorodnii 2 years ago
parent 784d48ef52
commit 7233616c2c
  1. 6
      src/plugins/startupfeedback/startupfeedback.cpp

@ -397,7 +397,11 @@ QImage StartupFeedbackEffect::scalePixmap(const QPixmap &pm, const QSize &size)
QPainter p(&result);
p.setCompositionMode(QPainter::CompositionMode_Source);
p.fillRect(result.rect(), Qt::transparent);
p.drawImage((20 * m_bounceSizesRatio - adjustedSize.width()) / 2, (20 * m_bounceSizesRatio - adjustedSize.height()) / 2, scaled, 0, 0, adjustedSize.width(), adjustedSize.height() * m_bounceSizesRatio);
p.drawImage(QRectF((20 * m_bounceSizesRatio - adjustedSize.width()) / 2,
(20 * m_bounceSizesRatio - adjustedSize.height()) / 2,
adjustedSize.width(),
adjustedSize.height()),
scaled);
return result;
}

Loading…
Cancel
Save