Browse Source

Merge pull request #7899 from takahirox/KeyframeTrackBugFix

Fix KeyframeTrack.trim() wrong stride calculation bug
Mr.doob 9 years ago
parent
commit
5d08cac75a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/animation/KeyframeTrack.js

+ 2 - 1
src/animation/KeyframeTrack.js

@@ -207,10 +207,11 @@ THREE.KeyframeTrack.prototype = {
 			var from = firstKeysToRemove;
 			var to = nKeys - lastKeysToRemove - firstKeysToRemove;
 
+			var stride = this.getValueSize();
+
 			this.times = THREE.AnimationUtils.arraySlice( times, from, to );
 
 			var values = this.values;
-			var stride = this.getValueSize();
 			this.values = THREE.AnimationUtils.arraySlice( values, from * stride, to * stride );
 
 		}