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

Method getCornerInRect

packages/react-stately/src/virtualizer/Rect.ts:130–138  ·  view source on GitHub ↗

* Returns the first corner of this rectangle (from top to bottom, left to right) * that is contained in the given rectangle, or null of the rectangles do not intersect. * * @param rect - The rectangle to check.

(rect: Rect)

Source from the content-addressed store, hash-verified

128 * @param rect - The rectangle to check.
129 */
130 getCornerInRect(rect: Rect): RectCorner | null {
131 for (let key of ['topLeft', 'topRight', 'bottomLeft', 'bottomRight']) {
132 if (rect.containsPoint(this[key])) {
133 return key as RectCorner;
134 }
135 }
136
137 return null;
138 }
139
140 equals(rect: Rect): boolean {
141 return (

Callers

nothing calls this directly

Calls 1

containsPointMethod · 0.80

Tested by

no test coverage detected