瀏覽代碼

Fix inconsistency of return value from BufferGeometry .addAttribute

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

+ 2 - 4
src/core/BufferGeometry.js

@@ -72,9 +72,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
 
 			console.warn( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' );
 
-			this.addAttribute( name, new BufferAttribute( arguments[ 1 ], arguments[ 2 ] ) );
-
-			return;
+			return this.addAttribute( name, new BufferAttribute( arguments[ 1 ], arguments[ 2 ] ) );
 
 		}
 
@@ -83,7 +81,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
 			console.warn( 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.' );
 			this.setIndex( attribute );
 
-			return;
+			return this;
 
 		}