QSwipeGestureRecognizer: Use qAbs() to check distances.
Task-number: QTBUG-15768 Change-Id: Idc6c6687430365a015fb2c15f4e4dcae6a687f9f Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>bb10
parent
3006bd2d44
commit
74303ad497
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue