wrong velocity calculation fixed

This commit is contained in:
Uwe Rathmann 2020-03-12 19:00:52 +01:00
parent 7af6d6fd09
commit 3c7308e23f

View File

@ -31,10 +31,10 @@ static inline qreal qskDistance(
const QPointF& from, const QPointF& to, Qt::Orientations orientations ) const QPointF& from, const QPointF& to, Qt::Orientations orientations )
{ {
if ( orientations == Qt::Horizontal ) if ( orientations == Qt::Horizontal )
return to.x() - from.x(); return std::fabs( to.x() - from.x() );
if ( orientations == Qt::Vertical ) 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 dx = to.x() - from.x();
const qreal dy = to.y() - from.y(); const qreal dy = to.y() - from.y();