Browse Source

Fix last animation keyframe bug (#9666)

Takahiro 9 years ago
parent
commit
9fb378df3d
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/animation/KeyframeTrackPrototype.js

+ 3 - 2
src/animation/KeyframeTrackPrototype.js

@@ -336,12 +336,13 @@ KeyframeTrackPrototype = {
 
 		// flush last keyframe (compaction looks ahead)
 
-		times[ writeIndex ++ ] = times[ lastIndex ];
+		times[ writeIndex ] = times[ lastIndex ];
 
-		for ( var readOffset = lastIndex * stride, j = 0; j !== stride; ++ j )
+		for ( var readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++ j )
 
 			values[ writeOffset + j ] = values[ readOffset + j ];
 
+		++ writeIndex;
 
 		if ( writeIndex !== times.length ) {