summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qhighdpiscaling_p.h
diff options
context:
space:
mode:
authorTang HaiXiang <tanghaixiang@uniontech.com>2020-07-24 16:48:36 +0800
committerTang HaiXiang <tanghaixiang@uniontech.com>2020-07-25 02:02:23 +0800
commitb4aee30692c166025b4e2283c19dbc1247bcce54 (patch)
treed8c0e20bad9e97bf19c20c479828fcee9b04abf7 /src/gui/kernel/qhighdpiscaling_p.h
parentfd0473f489a570eedbd61b69c2d201fe92f6c05e (diff)
Fix under non-integer scaling incorrect update area
Given some decimal scaling, the clipping of the QRegion/QRect passed to the QRegion/QRect done inside paintEvent cannot handle the decimal scaling. Solved by only converting QRect to a certain QRectF and calling QRectF overload instead of QRect. Fixes: QTBUG-82601 Fixes: QTBUG-64854 Pick-to: 5.15 Change-Id: I0d8f4193aabfc0d917612db68d2a39ebb726fa2f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/kernel/qhighdpiscaling_p.h')
-rw-r--r--src/gui/kernel/qhighdpiscaling_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qhighdpiscaling_p.h b/src/gui/kernel/qhighdpiscaling_p.h
index 1fee8564d9..ecbdabbb8d 100644
--- a/src/gui/kernel/qhighdpiscaling_p.h
+++ b/src/gui/kernel/qhighdpiscaling_p.h
@@ -204,7 +204,7 @@ inline QRegion scale(const QRegion &region, qreal scaleFactor, QPoint origin = Q
QRegion scaled;
for (const QRect &rect : region)
- scaled += scale(rect, scaleFactor, origin);
+ scaled += scale(QRectF(rect), scaleFactor, origin).toRect();
return scaled;
}