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>
This commit is contained in:
Tang HaiXiang 2020-07-24 16:48:36 +08:00
parent fd0473f489
commit b4aee30692

View File

@ -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;
}