瀏覽代碼

Clarify Loop end condition in BufferGeometry.merge()

Takahiro 6 年之前
父節點
當前提交
9b4df26fce
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/core/BufferGeometry.js

+ 1 - 1
src/core/BufferGeometry.js

@@ -822,7 +822,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
 
 
 			var attributeSize = attribute2.itemSize;
 			var attributeSize = attribute2.itemSize;
 
 
-			for ( var i = 0, j = attributeSize * offset; i < attributeArray2.length; i ++, j ++ ) {
+			for ( var i = 0, j = attributeSize * offset; i < attributeArray2.length && j < attributeArray1.length; i ++, j ++ ) {
 
 
 				attributeArray1[ j ] = attributeArray2[ i ];
 				attributeArray1[ j ] = attributeArray2[ i ];