pauses animation at end if loop is false
This commit is contained in:
parent
ba1ae9856c
commit
88ea3bee66
@ -30,7 +30,7 @@ var cancelAnimationFrame = global.cancelAnimationFrame
|
||||
this.options = torque.extend({
|
||||
animationDelay: 0,
|
||||
maxDelta: 0.2,
|
||||
loop: true
|
||||
loop: options.loop
|
||||
}, this.options);
|
||||
|
||||
this.rescale();
|
||||
@ -118,6 +118,9 @@ var cancelAnimationFrame = global.cancelAnimationFrame
|
||||
this.time(this._time);
|
||||
if(this.step() >= this.options.steps) {
|
||||
this._time = 0;
|
||||
if(!this.options.loop){
|
||||
this.pause();
|
||||
}
|
||||
}
|
||||
if(this.running) {
|
||||
requestAnimationFrame(this._tick);
|
||||
|
Loading…
Reference in New Issue
Block a user