(snapshot, label)
| 1515 | } |
| 1516 | |
| 1517 | function 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 | |
| 1537 | function openButtonCandidatePoints(snapshot) { |
| 1538 | const point = openButtonPoint(snapshot); |
no test coverage detected