From 3c7308e23f8a48513c7af3d4f42b404c897c23a4 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 12 Mar 2020 19:00:52 +0100 Subject: [PATCH] wrong velocity calculation fixed --- src/controls/QskPanGestureRecognizer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controls/QskPanGestureRecognizer.cpp b/src/controls/QskPanGestureRecognizer.cpp index facc981b..2a1963bf 100644 --- a/src/controls/QskPanGestureRecognizer.cpp +++ b/src/controls/QskPanGestureRecognizer.cpp @@ -31,10 +31,10 @@ static inline qreal qskDistance( const QPointF& from, const QPointF& to, Qt::Orientations orientations ) { if ( orientations == Qt::Horizontal ) - return to.x() - from.x(); + return std::fabs( to.x() - from.x() ); if ( orientations == Qt::Vertical ) - return to.y() - from.y(); + return std::fabs( to.y() - from.y() ); const qreal dx = to.x() - from.x(); const qreal dy = to.y() - from.y();