summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-09-03 07:40:01 (GMT)
committerShawn Rutledge <shawn.rutledge@digia.com>2014-09-04 08:27:46 (GMT)
commit4ae2df97db4bf2e07b7c3b9f03957eb62a36e969 (patch)
treec9f1d0903537328478458b94acc9f01f0d1fa5ea
parent8e720177ef18d471c8ffa455750fdcd375d7a8da (diff)
downloadQt-4ae2df97db4bf2e07b7c3b9f03957eb62a36e969.zip
Qt-4ae2df97db4bf2e07b7c3b9f03957eb62a36e969.tar.gz
Qt-4ae2df97db4bf2e07b7c3b9f03957eb62a36e969.tar.bz2
QSwipeGestureRecognizer: Use qAbs() to check distances.
Task-number: QTBUG-15768 Change-Id: Idc6c6687430365a015fb2c15f4e4dcae6a687f9f Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> (cherry picked from qtbase/74303ad497ff0e3a9876d349e2ce2f67f08c0fbf)
-rw-r--r--src/gui/kernel/qstandardgestures.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index de4188c..e80138b 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -348,7 +348,7 @@ QGestureRecognizer::Result QSwipeGestureRecognizer::recognize(QGesture *state,
d->swipeAngle = QLineF(p1.startScreenPos(), p1.screenPos()).angle();
static const int MoveThreshold = 50;
- if (xDistance > MoveThreshold || yDistance > MoveThreshold) {
+ if (qAbs(xDistance) > MoveThreshold || qAbs(yDistance) > MoveThreshold) {
// measure the distance to check if the direction changed
d->lastPositions[0] = p1.screenPos().toPoint();
d->lastPositions[1] = p2.screenPos().toPoint();