mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Remove unnecessary checks for rect.
This commit is contained in:
parent
cd80db14d8
commit
c8449162d8
1 changed files with 2 additions and 2 deletions
|
@ -164,7 +164,7 @@ var Rectangle = this.Rectangle = Base.extend({
|
|||
|
||||
equals: function(rect) {
|
||||
rect = Rectangle.read(arguments);
|
||||
return rect && this.x == rect.x && this.y == rect.y
|
||||
return this.x == rect.x && this.y == rect.y
|
||||
&& this.width == rect.width && this.height == rect.height;
|
||||
},
|
||||
|
||||
|
@ -187,7 +187,7 @@ var Rectangle = this.Rectangle = Base.extend({
|
|||
|
||||
intersects: function(rect) {
|
||||
rect = Rectangle.read(arguments);
|
||||
return rect && rect.x + rect.width > this.x
|
||||
return rect.x + rect.width > this.x
|
||||
&& rect.y + rect.height > this.y
|
||||
&& rect.x < this.x + this.width
|
||||
&& rect.y < this.y + this.height;
|
||||
|
|
Loading…
Reference in a new issue