diff --git a/src/torque.js b/src/torque.js index 087c5b1..3c8dc95 100644 --- a/src/torque.js +++ b/src/torque.js @@ -246,9 +246,13 @@ Torque.modules.layer = function (torque) { this.options.scrub_move(this) } if (this.running) { - setTimeout(function () { - this.play() - }.bind(this), pause + 1000 * 1 / this.options.fps); + if ( this.options.fps ) { + var ms = 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); + } } } }); @@ -376,4 +380,4 @@ function meterToPixels(mx, my, zoom) { var px = (mx + originShift) / res; var py = (my + originShift) / res; return [px, py]; -} \ No newline at end of file +}