* Returns the union of this Rect and another.
(other: Rect)
| 158 | * Returns the union of this Rect and another. |
| 159 | */ |
| 160 | union(other: Rect): Rect { |
| 161 | let x = Math.min(this.x, other.x); |
| 162 | let y = Math.min(this.y, other.y); |
| 163 | let width = Math.max(this.maxX, other.maxX) - x; |
| 164 | let height = Math.max(this.maxY, other.maxY) - y; |
| 165 | return new Rect(x, y, width, height); |
| 166 | } |
| 167 | |
| 168 | /** |
| 169 | * Returns the intersection of this Rect with another. |
no outgoing calls
no test coverage detected