1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-24 01:54:22 +00:00

Fix for accuracy in AnimatedPositionBehaviours

This commit is contained in:
jules 2014-01-31 15:33:18 +00:00
parent 7dcac1a0b3
commit 660b1ff649

View file

@ -129,7 +129,9 @@ namespace AnimatedPositionBehaviours
const double snapSpeed = 10.0;
const double velocity = (targetSnapPosition - oldPos) * snapSpeed;
return oldPos + velocity * elapsedSeconds;
const double newPos = oldPos + velocity * elapsedSeconds;
return isStopped (newPos) ? targetSnapPosition : newPos;
}
/** Called by the AnimatedPosition class to check whether the object