瀏覽代碼

Fix last animation keyframe bug (#9666)

Takahiro 9 年之前
父節點
當前提交
9fb378df3d
共有 1 個文件被更改,包括 3 次插入2 次删除
  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 ) {