@@ -571,7 +571,7 @@
var ratio = delay * (this.framePerSecond * speedRatio) / 1000.0;
var highLimitValue = 0;
- if (ratio > range && !loop) { // If we are out of range and not looping get back to caller
+ if (((to > from && ratio > range) || (from > to && ratio < range)) && !loop) { // If we are out of range and not looping get back to caller
returnValue = false;
highLimitValue = this._getKeyValue(this._keys[this._keys.length - 1].value);
} else {
@@ -1642,6 +1642,10 @@
*/
public beginAnimation(target: any, from: number, to: number, loop?: boolean, speedRatio: number = 1.0, onAnimationEnd?: () => void, animatable?: Animatable): Animatable {
+ if(from > to && speedRatio > 0){
+ speedRatio *= -1;
+ }
+
this.stopAnimation(target);
if (!animatable) {