QSwipeGestureRecognizer: Use qAbs() to check distances.

Task-number: QTBUG-15768
Change-Id: Idc6c6687430365a015fb2c15f4e4dcae6a687f9f
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
bb10
Friedemann Kleint 2014-09-03 09:40:01 +02:00
parent 3006bd2d44
commit 74303ad497
1 changed files with 1 additions and 1 deletions

View File

@ -335,7 +335,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();