mirror of
https://github.com/photonstorm/phaser
synced 2024-11-15 17:28:18 +00:00
Safer seek loop
This commit is contained in:
parent
b7a109bd26
commit
36c65618d7
1 changed files with 9 additions and 2 deletions
|
@ -496,11 +496,18 @@ var Tween = new Class({
|
|||
|
||||
if (amount > 0)
|
||||
{
|
||||
do
|
||||
var iterations = Math.floor(amount / delta);
|
||||
var remainder = amount - (iterations * delta);
|
||||
|
||||
for (var i = 0; i < iterations; i++)
|
||||
{
|
||||
this.update(delta);
|
||||
}
|
||||
|
||||
} while (this.totalElapsed < amount);
|
||||
if (remainder > 0)
|
||||
{
|
||||
this.update(remainder);
|
||||
}
|
||||
}
|
||||
|
||||
this.paused = isPaused;
|
||||
|
|
Loading…
Reference in a new issue