Sfoglia il codice sorgente

BufferAttribute: Moved deprecated code.

Mr.doob 9 anni fa
parent
commit
4471bd6562
2 ha cambiato i file con 11 aggiunte e 7 eliminazioni
  1. 11 0
      src/Three.Legacy.js
  2. 0 7
      src/core/BufferAttribute.js

+ 11 - 0
src/Three.Legacy.js

@@ -310,6 +310,17 @@ Object.defineProperties( THREE.Light.prototype, {
 
 //
 
+Object.defineProperties( THREE.BufferAttribute.prototype, {
+	length: {
+		get: function () {
+			console.warn( 'THREE.BufferAttribute: .length has been deprecated. Please use .count.' );
+			return this.array.length;
+		}
+	}
+} );
+
+//
+
 Object.defineProperties( THREE.Material.prototype, {
 	wrapAround: {
 		get: function () {

+ 0 - 7
src/core/BufferAttribute.js

@@ -20,13 +20,6 @@ THREE.BufferAttribute.prototype = {
 
 	constructor: THREE.BufferAttribute,
 
-	get length() {
-
-		console.warn( 'THREE.BufferAttribute: .length has been deprecated. Please use .count.' );
-		return this.array.length;
-
-	},
-
 	get count() {
 
 		return this.array.length / this.itemSize;