diff options
author | aavit <qt-info@nokia.com> | 2011-10-21 07:59:50 (GMT) |
---|---|---|
committer | aavit <qt-info@nokia.com> | 2011-10-21 07:59:50 (GMT) |
commit | cda84350a3e38d7a35e6341720e3e353803b8dea (patch) | |
tree | 240ba38d683ad1256ca7ddd54f51bf6f21962056 /src/declarative/util/qdeclarativespringanimation.cpp | |
parent | e5098123c12880d922923d1117f7b82995c6b5a0 (diff) | |
parent | 4673878256262802c07303fce1e1f8cc1b7e652b (diff) | |
download | Qt-cda84350a3e38d7a35e6341720e3e353803b8dea.zip Qt-cda84350a3e38d7a35e6341720e3e353803b8dea.tar.gz Qt-cda84350a3e38d7a35e6341720e3e353803b8dea.tar.bz2 |
Merge remote-tracking branch 'qt-fire-review/master'
Diffstat (limited to 'src/declarative/util/qdeclarativespringanimation.cpp')
-rw-r--r-- | src/declarative/util/qdeclarativespringanimation.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/declarative/util/qdeclarativespringanimation.cpp b/src/declarative/util/qdeclarativespringanimation.cpp index 2c6058c..0b453ee 100644 --- a/src/declarative/util/qdeclarativespringanimation.cpp +++ b/src/declarative/util/qdeclarativespringanimation.cpp @@ -161,17 +161,17 @@ bool QDeclarativeSpringAnimationPrivate::animate(const QDeclarativeProperty &pro animation.velocity = animation.velocity + (spring * diff - damping * animation.velocity) / mass; else animation.velocity = animation.velocity + spring * diff - damping * animation.velocity; - if (maxVelocity > 0.) { + if (maxVelocity > qreal(0.)) { // limit velocity if (animation.velocity > maxVelocity) animation.velocity = maxVelocity; else if (animation.velocity < -maxVelocity) animation.velocity = -maxVelocity; } - animation.currentValue += animation.velocity * 16.0 / 1000.0; + animation.currentValue += animation.velocity * qreal(16.0) / qreal(1000.0); if (haveModulus) { animation.currentValue = fmod(animation.currentValue, modulus); - if (animation.currentValue < 0.0) + if (animation.currentValue < qreal(0.0)) animation.currentValue += modulus; } } @@ -195,7 +195,7 @@ bool QDeclarativeSpringAnimationPrivate::animate(const QDeclarativeProperty &pro animation.currentValue = fmod(animation.currentValue, modulus); } else { animation.currentValue -= moveBy; - if (haveModulus && animation.currentValue < 0.0) + if (haveModulus && animation.currentValue < qreal(0.0)) animation.currentValue = fmod(animation.currentValue, modulus) + modulus; } if (lastTime - animation.start >= animation.duration) { |