Skip to content

Commit 1a357e1

Browse files
committed
Rectangle contains updates.
1 parent b580746 commit 1a357e1

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ Version 2.1.3 - "Ravinda" - in development
8686

8787
### Updates
8888

89+
* TypeScript definitions fixes and updates (thanks @clark-stevenson)
8990
* Changed the Animation constructor parameter `delay` to `frameRate` as it's a more accurate term of what it should be. Internally nothing changed.
9091
* Circle.getBounds added.
9192
* Ellipse.getBounds added.

src/geom/Rectangle.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ Phaser.Rectangle.contains = function (a, x, y) {
687687
return false;
688688
}
689689

690-
return (x >= a.x && x <= a.right && y >= a.y && y <= a.bottom);
690+
return (x >= a.x && x < a.right && y >= a.y && y < a.bottom);
691691

692692
};
693693

@@ -704,7 +704,7 @@ Phaser.Rectangle.contains = function (a, x, y) {
704704
*/
705705
Phaser.Rectangle.containsRaw = function (rx, ry, rw, rh, x, y) {
706706

707-
return (x >= rx && x <= (rx + rw) && y >= ry && y <= (ry + rh));
707+
return (x >= rx && x < (rx + rw) && y >= ry && y < (ry + rh));
708708

709709
};
710710

@@ -737,7 +737,7 @@ Phaser.Rectangle.containsRect = function (a, b) {
737737
return false;
738738
}
739739

740-
return (a.x >= b.x && a.y >= b.y && a.right <= b.right && a.bottom <= b.bottom);
740+
return (a.x >= b.x && a.y >= b.y && a.right < b.right && a.bottom < b.bottom);
741741

742742
};
743743

0 commit comments

Comments
 (0)