From 5a27243f074d3f591059fe00424971857a4e6bbe Mon Sep 17 00:00:00 2001 From: Francisco Dans Date: Thu, 26 Feb 2015 16:02:06 +0100 Subject: [PATCH 1/2] makes sure that animation is paused when steps is one --- lib/torque/animator.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/torque/animator.js b/lib/torque/animator.js index 99b22d1..5512440 100644 --- a/lib/torque/animator.js +++ b/lib/torque/animator.js @@ -46,6 +46,9 @@ var cancelAnimationFrame = global.cancelAnimationFrame this.running = true; requestAnimationFrame(this._tick); this.options.onStart && this.options.onStart(); + if(this.options.steps === 1){ + this.running = false; + } }, isRunning: function() { From 767fae627234e69ab751264f245059fef85dbacb Mon Sep 17 00:00:00 2001 From: Francisco Dans Date: Mon, 2 Mar 2015 11:43:18 +0100 Subject: [PATCH 2/2] adds start in animator rescale --- lib/torque/animator.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/torque/animator.js b/lib/torque/animator.js index 5512440..f4be9c9 100644 --- a/lib/torque/animator.js +++ b/lib/torque/animator.js @@ -83,6 +83,7 @@ var cancelAnimationFrame = global.cancelAnimationFrame this.range = torque.math.linear(0, this.options.steps); this.rangeInv = this.range.invert(); this.time(this._time); + this.start(); return this; },