* Determines whether another Rectangle is fully contained within this Rectangle. * * Rectangles that occupy the same space are considered to be containing each other. * * Rectangles without area (width or height equal to zero) can't contain anything, * not even other areales
(other: Rectangle)
| 793 | * @see {@link Rectangle.intersects} For overlap testing |
| 794 | */ |
| 795 | public containsRect(other: Rectangle): boolean |
| 796 | { |
| 797 | if (this.width <= 0 || this.height <= 0) return false; |
| 798 | |
| 799 | const x1 = other.x; |
| 800 | const y1 = other.y; |
| 801 | const x2 = other.x + other.width; |
| 802 | const y2 = other.y + other.height; |
| 803 | |
| 804 | return x1 >= this.x && x1 < this.x + this.width |
| 805 | && y1 >= this.y && y1 < this.y + this.height |
| 806 | && x2 >= this.x && x2 < this.x + this.width |
| 807 | && y2 >= this.y && y2 < this.y + this.height; |
| 808 | } |
| 809 | |
| 810 | /** |
| 811 | * Sets the position and dimensions of the rectangle. |
no outgoing calls
no test coverage detected