┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Edmundson <[email protected]>2015-03-25 12:41:18 +0100
committerDavid Edmundson <[email protected]>2015-03-25 18:31:40 +0100
commitff8c61dbca42009246236f746cfdea651187bb9b (patch)
treeca180ac22ee7000c698e38fc4fbecc46b7f8d201 /src
parent1fac8a7bbac28ea871f0a95dfe0b7d6ddcb2512a (diff)
Copy device pixel ratio from original pixmap inside KPixmapModifier::scale
Diffstat (limited to 'src')
-rw-r--r--src/kitemviews/private/kpixmapmodifier.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/kitemviews/private/kpixmapmodifier.cpp b/src/kitemviews/private/kpixmapmodifier.cpp
index c564ecc30..ee1f84366 100644
--- a/src/kitemviews/private/kpixmapmodifier.cpp
+++ b/src/kitemviews/private/kpixmapmodifier.cpp
@@ -347,6 +347,7 @@ void KPixmapModifier::scale(QPixmap& pixmap, const QSize& scaledSize)
}};
QPixmap scaledPixmap(scaledPixmapSize);
+ scaledPixmap.setDevicePixelRatio(pixmap.devicePixelRatio());
scaledPixmap.fill(Qt::transparent);
Display* dpy = QX11Info::display();
@@ -364,7 +365,9 @@ void KPixmapModifier::scale(QPixmap& pixmap, const QSize& scaledSize)
pixmap = pixmap.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
}
#else
+ qreal dpr = pixmap.devicePixelRatio();
pixmap = pixmap.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+ pixmap.setDevicePixelRatio(dpr);
#endif
}