mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 09:50:12 +00:00
Copy device pixel ratio from original pixmap inside KPixmapModifier::scale
This commit is contained in:
parent
1fac8a7bba
commit
ff8c61dbca
|
@ -347,6 +347,7 @@ void KPixmapModifier::scale(QPixmap& pixmap, const QSize& scaledSize)
|
||||||
}};
|
}};
|
||||||
|
|
||||||
QPixmap scaledPixmap(scaledPixmapSize);
|
QPixmap scaledPixmap(scaledPixmapSize);
|
||||||
|
scaledPixmap.setDevicePixelRatio(pixmap.devicePixelRatio());
|
||||||
scaledPixmap.fill(Qt::transparent);
|
scaledPixmap.fill(Qt::transparent);
|
||||||
|
|
||||||
Display* dpy = QX11Info::display();
|
Display* dpy = QX11Info::display();
|
||||||
|
@ -364,7 +365,9 @@ void KPixmapModifier::scale(QPixmap& pixmap, const QSize& scaledSize)
|
||||||
pixmap = pixmap.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
pixmap = pixmap.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
qreal dpr = pixmap.devicePixelRatio();
|
||||||
pixmap = pixmap.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
pixmap = pixmap.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
|
pixmap.setDevicePixelRatio(dpr);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue