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

Method union

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

* Returns the union of this Rect and another.

(other: Rect)

Source from the content-addressed store, hash-verified

158 * Returns the union of this Rect and another.
159 */
160 union(other: Rect): Rect {
161 let x = Math.min(this.x, other.x);
162 let y = Math.min(this.y, other.y);
163 let width = Math.max(this.maxX, other.maxX) - x;
164 let height = Math.max(this.maxY, other.maxY) - y;
165 return new Rect(x, y, width, height);
166 }
167
168 /**
169 * Returns the intersection of this Rect with another.

Callers 3

layoutIfNeededMethod · 0.80
getKeyRangeMethod · 0.80
index.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected