From 83470288715e925334cb24292630c7ff13a038da Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Thu, 6 Oct 2022 14:24:11 +0800 Subject: [PATCH] fix: blurry when raster image scaled down --- app/graphicsscene.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/graphicsscene.cpp b/app/graphicsscene.cpp index 01e5686..bc1064a 100644 --- a/app/graphicsscene.cpp +++ b/app/graphicsscene.cpp @@ -29,8 +29,9 @@ public: if (qFuzzyCompare(scaleHint, m_cachedScaleHint)) return m_cachedPixmap; QSizeF resizedScale(boundingRect().size()); resizedScale *= scaleHint; - m_cachedPixmap = pixmap().scaled( - resizedScale.toSize(), + QPixmap && sourcePixmap = pixmap(); + m_cachedPixmap = sourcePixmap.scaled( + resizedScale.toSize() * sourcePixmap.devicePixelRatioF(), Qt::KeepAspectRatio, Qt::SmoothTransformation); m_cachedScaleHint = scaleHint;