[KStandardItemListWidget] Avoid needless image resizing

There be rounding errors when scaling pixmaps when keeping aspect ratio

Differential Revision: https://phabricator.kde.org/D11319
This commit is contained in:
Kai Uwe Broulik 2018-07-11 15:41:58 +02:00
parent 64f7108d83
commit ae3438eb08

View file

@ -1011,7 +1011,8 @@ void KStandardItemListWidget::updatePixmapCache()
const int maxScaledIconHeight = scaledIconSize;
m_scaledPixmapSize = m_pixmap.size();
m_scaledPixmapSize.scale(maxScaledIconWidth, maxScaledIconHeight, Qt::KeepAspectRatio);
m_scaledPixmapSize.scale(maxScaledIconWidth * qApp->devicePixelRatio(), maxScaledIconHeight * qApp->devicePixelRatio(), Qt::KeepAspectRatio);
m_scaledPixmapSize = m_scaledPixmapSize / qApp->devicePixelRatio();
if (iconOnTop) {
// Center horizontally and align on bottom within the icon-area