|
@@ -133,17 +133,25 @@ function SimpleTween(duration, start, end, easing) {
|
|
|
this.deferred = Q.defer();
|
|
|
this.timer = 0;
|
|
|
this.promise = this.deferred.promise;
|
|
|
+ if(this.duration == 0) {
|
|
|
+ this.deferred.resolve();
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
SimpleTween.prototype = new BaseTween();
|
|
|
|
|
|
SimpleTween.prototype.update = function(dt) {
|
|
|
- this.timer += dt;
|
|
|
- if(this.timer >= this.duration) {
|
|
|
- this.timer = this.duration;
|
|
|
- this.deferred.resolve();
|
|
|
+ if(this.duration > 0) {
|
|
|
+ this.timer += dt;
|
|
|
+ if(this.timer >= this.duration) {
|
|
|
+ this.timer = this.duration;
|
|
|
+ this.deferred.resolve();
|
|
|
+ }
|
|
|
+ this.value = this.easing(this.timer, this.start, this.end, this.duration);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.value = this.end;
|
|
|
}
|
|
|
- this.value = this.easing(this.timer, this.start, this.end, this.duration);
|
|
|
};
|
|
|
|
|
|
function PromiseTween(value, promise) {
|