check loop condition before render

This commit is contained in:
javi 2014-12-16 17:42:35 +01:00
parent f002f3d9d4
commit 8a8455922d

View File

@ -115,7 +115,6 @@ var cancelAnimationFrame = global.cancelAnimationFrame
delta = Math.min(this.options.maxDelta, delta);
this._t0 = t1;
this._time += delta;
this.time(this._time);
if(this.step() >= this.options.steps) {
this._time = 0;
if(!this.options.loop){
@ -123,6 +122,7 @@ var cancelAnimationFrame = global.cancelAnimationFrame
}
}
if(this.running) {
this.time(this._time);
requestAnimationFrame(this._tick);
}
}