Jelajahi Sumber

Rectangle: Added equals()

Mr.doob 10 tahun lalu
induk
melakukan
e7d7a1fa58
1 mengubah file dengan 6 tambahan dan 0 penghapusan
  1. 6 0
      src/math/Rectangle.js

+ 6 - 0
src/math/Rectangle.js

@@ -32,6 +32,12 @@ THREE.Rectangle.prototype = {
 
 
 		return this;
 		return this;
 
 
+	},
+
+	equals: function ( rectangle ) {
+
+		return this.x === rectangle.x && this.y === rectangle.y && this.width === rectangle.width && this.height === rectangle.height;
+
 	}
 	}
 
 
 };
 };

粤ICP备19079148号