(box1: Rect, box2: Rect)
| 16 | * extendARect |
| 17 | */ |
| 18 | export function extendRect(box1: Rect, box2: Rect): Rect { |
| 19 | const x = Math.min(box1.x, box2.x); |
| 20 | const y = Math.min(box1.y, box2.y); |
| 21 | const width = Math.max(box1.x + box1.width, box2.x + box2.width) - x; |
| 22 | const height = Math.max(box1.y + box1.height, box2.y + box2.height) - y; |
| 23 | return { x, y, width, height }; |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * 判断一个 Rect 是否包含另外一个 Rect |
nothing calls this directly
no outgoing calls
no test coverage detected