Bläddra i källkod

Merge pull request #1523 from boyofgreen/master

check that to and from keys are not the same
David Catuhe 8 år sedan
förälder
incheckning
796920ee3b
1 ändrade filer med 6 tillägg och 0 borttagningar
  1. 6 0
      src/Animations/babylon.animation.ts

+ 6 - 0
src/Animations/babylon.animation.ts

@@ -455,6 +455,7 @@
             if (this.targetPropertyPath.length > 1) {
                 var property = this._target[this.targetPropertyPath[0]];
 
+
                 for (var index = 1; index < this.targetPropertyPath.length - 1; index++) {
                     property = property[this.targetPropertyPath[index]];
                 }
@@ -532,6 +533,11 @@
                 to = this._keys[this._keys.length - 1].frame;
             }
 
+            //to and from cannot be the same key
+            if(from === to) {
+                from++;
+            }
+            
             // Compute ratio
             var range = to - from;
             var offsetValue;