Fix QHighDpi::fromNativeLocalExposedRegion rounding errors
Ceiling width/height fails to take into account rects that do no have their top left position on an exact point boundary. Example: QRect(0,0 20x20) and QRect(1,1 20x20) with scale 2.0 would give the same result of QRect(0,0 10x10). The correct rects are QRect(0,0 10x10) and QRect(0,0 11x11), so that we are sure to repaint all pixels within the exposed region. Before 5138fada0b9c, rects were also rounded incorrectly. The old method would give the result of QRect(0,0 11x11) in both cases, causing the exposed region to be larger than a window. Amends 5138fada0b9ce3968b23ec11df5f0d4e67544c43 Task-number: QTBUG-63943 Change-Id: I9f3dddf649bdc506c23bce1b6704860d61481459 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
dfdd99fc12
commit
7d10936443
@ -402,7 +402,8 @@ inline QRegion fromNativeLocalExposedRegion(const QRegion &pixelRegion, const QW
|
||||
const QPointF topLeftP = rect.topLeft() / scaleFactor;
|
||||
const QSizeF sizeP = rect.size() / scaleFactor;
|
||||
pointRegion += QRect(QPoint(qFloor(topLeftP.x()), qFloor(topLeftP.y())),
|
||||
QSize(qCeil(sizeP.width()), qCeil(sizeP.height())));
|
||||
QPoint(qCeil(topLeftP.x() + sizeP.width() - 1.0),
|
||||
qCeil(topLeftP.y() + sizeP.height() - 1.0)));
|
||||
}
|
||||
return pointRegion;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user