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:
parent
7dcac1a0b3
commit
660b1ff649
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue