diff options
| author | Kai Uwe Broulik <[email protected]> | 2018-07-11 15:41:58 +0200 |
|---|---|---|
| committer | Kai Uwe Broulik <[email protected]> | 2018-07-11 15:41:58 +0200 |
| commit | ae3438eb080976cb6f04c4189042842845590efc (patch) | |
| tree | 80790bf7ebe4a58abc017b91dca59ad30188663e /src | |
| parent | 64f7108d83e987d6719f84abe97585a78b537c05 (diff) | |
[KStandardItemListWidget] Avoid needless image resizing
There be rounding errors when scaling pixmaps when keeping aspect ratio
Differential Revision: https://phabricator.kde.org/D11319
Diffstat (limited to 'src')
| -rw-r--r-- | src/kitemviews/kstandarditemlistwidget.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp index bc3bb29de..8b7eacf44 100644 --- a/src/kitemviews/kstandarditemlistwidget.cpp +++ b/src/kitemviews/kstandarditemlistwidget.cpp @@ -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 |
