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

Function buttonCandidatePoints

scripts/integration/cli.mjs:1517–1535  ·  view source on GitHub ↗
(snapshot, label)

Source from the content-addressed store, hash-verified

1515}
1516
1517function buttonCandidatePoints(snapshot, label) {
1518 const point = buttonPoint(snapshot, label);
1519 if (!point) {
1520 return [];
1521 }
1522 const bounds = rootBounds(snapshot);
1523 const candidates = [point, { x: point.y, y: point.x }];
1524 if (bounds) {
1525 candidates.push(
1526 { x: bounds.width - point.x, y: point.y },
1527 { x: point.x, y: bounds.height - point.y },
1528 { x: point.y, y: bounds.width - point.x },
1529 { x: bounds.height - point.y, y: point.x },
1530 );
1531 }
1532 return uniquePoints(candidates).filter(
1533 (candidate) => candidate.x >= 0 && candidate.y >= 0,
1534 );
1535}
1536
1537function openButtonCandidatePoints(snapshot) {
1538 const point = openButtonPoint(snapshot);

Callers 1

keyboardTipPromptActionsFunction · 0.85

Calls 3

buttonPointFunction · 0.85
rootBoundsFunction · 0.85
uniquePointsFunction · 0.85

Tested by

no test coverage detected