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

Function rectCorners

packages/react-aria/src/tooltip/useSafeArea.ts:109–120  ·  view source on GitHub ↗
(rect: DOMRect)

Source from the content-addressed store, hash-verified

107}
108
109function rectCorners(rect: DOMRect): Point[] {
110 let left = rect.left - PADDING;
111 let right = rect.right + PADDING;
112 let top = rect.top - PADDING;
113 let bottom = rect.bottom + PADDING;
114 return [
115 {x: left, y: top},
116 {x: right, y: top},
117 {x: right, y: bottom},
118 {x: left, y: bottom}
119 ];
120}
121
122// Computes the convex hull of a set of points using the monotone chain algorithm.
123function convexHull(points: Point[]): Point[] {

Callers 1

isPointInSafeAreaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected