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({
|
this.options = torque.extend({
|
||||||
animationDelay: 0,
|
animationDelay: 0,
|
||||||
maxDelta: 0.2,
|
maxDelta: 0.2,
|
||||||
loop: true
|
loop: options.loop
|
||||||
}, this.options);
|
}, this.options);
|
||||||
|
|
||||||
this.rescale();
|
this.rescale();
|
||||||
@ -118,6 +118,9 @@ var cancelAnimationFrame = global.cancelAnimationFrame
|
|||||||
this.time(this._time);
|
this.time(this._time);
|
||||||
if(this.step() >= this.options.steps) {
|
if(this.step() >= this.options.steps) {
|
||||||
this._time = 0;
|
this._time = 0;
|
||||||
|
if(!this.options.loop){
|
||||||
|
this.pause();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(this.running) {
|
if(this.running) {
|
||||||
requestAnimationFrame(this._tick);
|
requestAnimationFrame(this._tick);
|
||||||
|
Loading…
Reference in New Issue
Block a user