window: fix interactiveMove exit condition

Previously the <= 1.0 test always succeeds in the first try, causing the
loop to exit prematurely.

BUG:  481610
This commit is contained in:
Yifan Zhu 2024-03-18 16:46:15 -07:00
parent c1a2355d71
commit 701f914081

View file

@ -1738,10 +1738,10 @@ QRectF Window::nextInteractiveMoveGeometry(const QPointF &global) const
nextMoveResizeGeom = currentTry;
// sinces nextMoveResizeGeom is fractional, at best it is within 1 unit of currentMoveResizeGeom
if (std::abs(currentMoveResizeGeom.left() - nextMoveResizeGeom.left()) <= 1.0
&& std::abs(currentMoveResizeGeom.right() - nextMoveResizeGeom.right()) <= 1.0
&& std::abs(currentMoveResizeGeom.top() - nextMoveResizeGeom.top()) <= 1.0
&& std::abs(currentMoveResizeGeom.bottom() - nextMoveResizeGeom.bottom()) <= 1.0) {
if (std::abs(currentMoveResizeGeom.left() - nextMoveResizeGeom.left()) < 1.0
&& std::abs(currentMoveResizeGeom.right() - nextMoveResizeGeom.right()) < 1.0
&& std::abs(currentMoveResizeGeom.top() - nextMoveResizeGeom.top()) < 1.0
&& std::abs(currentMoveResizeGeom.bottom() - nextMoveResizeGeom.bottom()) < 1.0) {
break; // Prevent lockup
}
}