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

Method intersectRects

packages/fairygui/src/render/RenderBridge.ts:297–309  ·  view source on GitHub ↗
(a: IRectangle, b: IRectangle)

Source from the content-addressed store, hash-verified

295 }
296
297 private intersectRects(a: IRectangle, b: IRectangle): IRectangle {
298 const x = Math.max(a.x, b.x);
299 const y = Math.max(a.y, b.y);
300 const right = Math.min(a.x + a.width, b.x + b.width);
301 const bottom = Math.min(a.y + a.height, b.y + b.height);
302
303 return {
304 x,
305 y,
306 width: Math.max(0, right - x),
307 height: Math.max(0, bottom - y)
308 };
309 }
310}

Callers 1

pushClipRectMethod · 0.95

Calls 2

maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected