aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/gifs
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-10-07 09:23:23 +0200
committerMitch Curtis <mitch.curtis@qt.io>2016-10-07 07:47:34 +0000
commit7b93344a01619783c3f08e3abcdbdc5c00bcaf68 (patch)
treecf2bdf9a657e8e21405d5d1b7894e5ccb224257a /tests/manual/gifs
parent176ec0be1dee531461f13f55a945ae0ebc69397f (diff)
tst_gifs: round mouse event coordinates
This prevents the last move event being 1 pixel short of the destination, which resulted in release events not being exactly over the last move event and hence choppy GIFs. Change-Id: I5514ec53f2691700105a9188f8bce203ee2ddcc5 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/manual/gifs')
-rw-r--r--tests/manual/gifs/tst_gifs.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/manual/gifs/tst_gifs.cpp b/tests/manual/gifs/tst_gifs.cpp
index 33964aec..8bbd3ba8 100644
--- a/tests/manual/gifs/tst_gifs.cpp
+++ b/tests/manual/gifs/tst_gifs.cpp
@@ -103,8 +103,8 @@ void tst_Gifs::moveSmoothly(QQuickWindow *window, const QPoint &from, const QPoi
int yDifference = to.y() - from.y();
for (int movement = 0; movement < movements; ++movement) {
QPoint pos = QPoint(
- from.x() + curve.valueForProgress(movement / qreal(qAbs(xDifference))) * xDifference,
- from.y() + curve.valueForProgress(movement / qreal(qAbs(yDifference))) * yDifference);
+ from.x() + qRound(curve.valueForProgress(movement / qreal(qAbs(xDifference))) * xDifference),
+ from.y() + qRound(curve.valueForProgress(movement / qreal(qAbs(yDifference))) * yDifference));
QTest::mouseMove(window, pos, movementDelay);
}
}