Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[qtdeclarative] Fix some type errors with qreal=double. Contributes t…
…o JB#49697
  • Loading branch information
pvuorela authored and mkosola committed Oct 4, 2020
1 parent 9194e2f commit d2834ef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/quick/items/qquickflickable.cpp
Expand Up @@ -1073,9 +1073,9 @@ void QQuickFlickablePrivate::drag(qint64 currentTimestamp, QEvent::Type eventTyp
} else {
qreal vel = velocity.y() / overshootFriction;
if (vel > 0. && vel > vData.velocity)
vData.velocity = qMin(velocity.y() / overshootFriction, float(defaultMaxVelocity));
vData.velocity = qMin(vel, defaultMaxVelocity);
else if (vel < 0. && vel < vData.velocity)
vData.velocity = qMax(velocity.y() / overshootFriction, -float(defaultMaxVelocity));
vData.velocity = qMax(vel, -defaultMaxVelocity);
if (newY > minY) {
// Overshoot beyond the top. But don't wait for momentum phase to end before returning to bounds.
if (momentum && vData.atBeginning) {
Expand Down Expand Up @@ -1146,9 +1146,9 @@ void QQuickFlickablePrivate::drag(qint64 currentTimestamp, QEvent::Type eventTyp
} else {
qreal vel = velocity.x() / overshootFriction;
if (vel > 0. && vel > hData.velocity)
hData.velocity = qMin(velocity.x() / overshootFriction, float(defaultMaxVelocity));
hData.velocity = qMin(vel, defaultMaxVelocity);
else if (vel < 0. && vel < hData.velocity)
hData.velocity = qMax(velocity.x() / overshootFriction, -float(defaultMaxVelocity));
hData.velocity = qMax(vel, -defaultMaxVelocity);
if (newX > minX) {
// Overshoot beyond the left. But don't wait for momentum phase to end before returning to bounds.
if (momentum && hData.atBeginning) {
Expand Down

0 comments on commit d2834ef

Please sign in to comment.