fix: blurry when raster image scaled down

This commit is contained in:
Gary Wang 2022-10-06 14:24:11 +08:00
parent 1cc5480f7d
commit 8347028871
No known key found for this signature in database
GPG Key ID: 5D30A4F15EA78760

View File

@ -29,8 +29,9 @@ public:
if (qFuzzyCompare(scaleHint, m_cachedScaleHint)) return m_cachedPixmap; if (qFuzzyCompare(scaleHint, m_cachedScaleHint)) return m_cachedPixmap;
QSizeF resizedScale(boundingRect().size()); QSizeF resizedScale(boundingRect().size());
resizedScale *= scaleHint; resizedScale *= scaleHint;
m_cachedPixmap = pixmap().scaled( QPixmap && sourcePixmap = pixmap();
resizedScale.toSize(), m_cachedPixmap = sourcePixmap.scaled(
resizedScale.toSize() * sourcePixmap.devicePixelRatioF(),
Qt::KeepAspectRatio, Qt::KeepAspectRatio,
Qt::SmoothTransformation); Qt::SmoothTransformation);
m_cachedScaleHint = scaleHint; m_cachedScaleHint = scaleHint;