mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Clean up Point#equals() code.
This commit is contained in:
parent
5e7b15c64e
commit
d9efb888bc
1 changed files with 5 additions and 4 deletions
|
@ -199,10 +199,11 @@ var Point = Base.extend(/** @lends Point# */{
|
|||
* console.log(point != new Point(1, 1)); // true
|
||||
*/
|
||||
equals: function(point) {
|
||||
return point === this || point && (this.x === point.x
|
||||
&& this.y === point.y
|
||||
|| Array.isArray(point) && this.x === point[0]
|
||||
&& this.y === point[1]) || false;
|
||||
return this === point || point
|
||||
&& (this.x === point.x && this.y === point.y
|
||||
|| Array.isArray(point)
|
||||
&& this.x === point[0] && this.y === point[1])
|
||||
|| false;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue