({x, y}: Point, rect: Rect)
| 116 | } |
| 117 | |
| 118 | export function rectContainsPoint({x, y}: Point, rect: Rect): boolean { |
| 119 | const [top, right, bottom, left] = rectToBox(rect); |
| 120 | return left <= x && x <= right && top <= y && y <= bottom; |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * Returns the smallest rectangle that contains all provided rects. |
no test coverage detected