MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / rectOverlapArea

Function rectOverlapArea

packages/nativescript-inspector/src/index.ts:1698–1710  ·  view source on GitHub ↗
(left: JSONObject, right: JSONObject)

Source from the content-addressed store, hash-verified

1696}
1697
1698function rectOverlapArea(left: JSONObject, right: JSONObject): number {
1699 const x1 = Math.max(rectNumber(left, "x"), rectNumber(right, "x"));
1700 const y1 = Math.max(rectNumber(left, "y"), rectNumber(right, "y"));
1701 const x2 = Math.min(
1702 rectNumber(left, "x") + rectNumber(left, "width"),
1703 rectNumber(right, "x") + rectNumber(right, "width"),
1704 );
1705 const y2 = Math.min(
1706 rectNumber(left, "y") + rectNumber(left, "height"),
1707 rectNumber(right, "y") + rectNumber(right, "height"),
1708 );
1709 return Math.max(0, x2 - x1) * Math.max(0, y2 - y1);
1710}
1711
1712function tabBarControlLabel(control: any): string {
1713 const accessibility = accessibilityInfo(control);

Callers 1

substantiallyOverlapsFunction · 0.85

Calls 2

rectNumberFunction · 0.85
maxMethod · 0.80

Tested by

no test coverage detected