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

Function isRectIntersect

packages/common/utils/math.ts:6–13  ·  view source on GitHub ↗
(a: Rect, b: Rect)

Source from the content-addressed store, hash-verified

4 * 实现一个函数,判断
5 */
6export function isRectIntersect(a: Rect, b: Rect) {
7 return (
8 a.x < b.x + b.width &&
9 a.x + a.width > b.x &&
10 a.y < b.y + b.height &&
11 a.y + a.height > b.y
12 );
13}
14
15/**
16 * extendARect

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected