MCPcopy Create free account
hub / github.com/6174/comflowyspace / extendRect

Function extendRect

packages/common/utils/math.ts:18–24  ·  view source on GitHub ↗
(box1: Rect, box2: Rect)

Source from the content-addressed store, hash-verified

16 * extendARect
17 */
18export 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected