Don't loop as hell when FPS is zero

This commit is contained in:
Sandro Santilli 2013-05-14 16:27:18 +02:00
parent 9b3b501764
commit 153f7341fe

View File

@ -246,9 +246,13 @@ Torque.modules.layer = function (torque) {
this.options.scrub_move(this) this.options.scrub_move(this)
} }
if (this.running) { if (this.running) {
setTimeout(function () { if ( this.options.fps ) {
this.play() var ms = pause + 1000 * 1 / this.options.fps;
}.bind(this), pause + 1000 * 1 / this.options.fps); //console.log("play timeout: " + ms + " ms (pause:" + pause + ", fps:" + this.options.fps + ")");
setTimeout(function () {
this.play()
}.bind(this), ms);
}
} }
} }
}); });