(candidate: HintRect)
| 218 | const covers = (candidate: HintRect): number => |
| 219 | protect.reduce((sum, rect) => sum + overlapArea(candidate, rect), 0); |
| 220 | const inside = (candidate: HintRect): boolean => |
| 221 | candidate.x >= margin |
| 222 | && candidate.y >= margin |
| 223 | && candidate.x + candidate.width <= viewport.width - margin |
| 224 | && candidate.y + candidate.height <= viewport.height - margin; |
| 225 | |
| 226 | const tries: HintRect[] = []; |
| 227 | for (const rect of protect) { |