MCPcopy Create free account
hub / github.com/adobe/react-spectrum / rectContains

Function rectContains

packages/react-aria/src/tooltip/useSafeArea.ts:100–107  ·  view source on GitHub ↗
(rect: DOMRect, point: Point)

Source from the content-addressed store, hash-verified

98}
99
100function rectContains(rect: DOMRect, point: Point): boolean {
101 return (
102 point.x >= rect.left - PADDING &&
103 point.x <= rect.right + PADDING &&
104 point.y >= rect.top - PADDING &&
105 point.y <= rect.bottom + PADDING
106 );
107}
108
109function rectCorners(rect: DOMRect): Point[] {
110 let left = rect.left - PADDING;

Callers 1

isPointInSafeAreaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected