Merge pull request #138 from CartoDB/onesteppause
Makes sure that animation is paused when steps === one
This commit is contained in:
commit
6ba2e42625
@ -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() {
|
||||
@ -80,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;
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user