MCPcopy Create free account
hub / github.com/esengine/esengine / union

Method union

packages/fairygui/src/utils/MathTypes.ts:139–147  ·  view source on GitHub ↗
(other: IRectangle, out?: Rectangle)

Source from the content-addressed store, hash-verified

137 }
138
139 public union(other: IRectangle, out?: Rectangle): Rectangle {
140 const x = Math.min(this.x, other.x);
141 const y = Math.min(this.y, other.y);
142 const right = Math.max(this.right, other.x + other.width);
143 const bottom = Math.max(this.bottom, other.y + other.height);
144
145 out = out || new Rectangle();
146 return out.set(x, y, right - x, bottom - y);
147 }
148
149 public isEmpty(): boolean {
150 return this.width <= 0 || this.height <= 0;

Callers

nothing calls this directly

Calls 3

setMethod · 0.65
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected