From b4aee30692c166025b4e2283c19dbc1247bcce54 Mon Sep 17 00:00:00 2001 From: Tang HaiXiang Date: Fri, 24 Jul 2020 16:48:36 +0800 Subject: 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 --- src/gui/kernel/qhighdpiscaling_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/kernel/qhighdpiscaling_p.h') 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 ®ion, 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; } -- cgit v1.2.3