Fix Animated spring jest test
Reviewed By: TheSavior Differential Revision: D5786252 fbshipit-source-id: 9f97b36bd2d6faebc95f2f78889fb382a3544479
This commit is contained in:
Родитель
c88b2b2c65
Коммит
1afc93d18a
|
@ -196,7 +196,10 @@ class SpringAnimation extends Animation {
|
||||||
// The following post provides a lot of thoughts into how to build this
|
// The following post provides a lot of thoughts into how to build this
|
||||||
// loop: http://gafferongames.com/game-physics/fix-your-timestep/
|
// loop: http://gafferongames.com/game-physics/fix-your-timestep/
|
||||||
const TIMESTEP_MSEC = 1;
|
const TIMESTEP_MSEC = 1;
|
||||||
const numSteps = Math.floor((now - this._lastTime) / TIMESTEP_MSEC);
|
const numSteps = Math.max(
|
||||||
|
1, // Always take at least one step to make progress.
|
||||||
|
Math.floor((now - this._lastTime) / TIMESTEP_MSEC),
|
||||||
|
);
|
||||||
|
|
||||||
for (let i = 0; i < numSteps; ++i) {
|
for (let i = 0; i < numSteps; ++i) {
|
||||||
// Velocity is based on seconds instead of milliseconds
|
// Velocity is based on seconds instead of milliseconds
|
||||||
|
|
Загрузка…
Ссылка в новой задаче