(x: int, y: int)
| 313 | // Draws a 9*9 finder pattern including the border separator, |
| 314 | // with the center module at (x, y). Modules can be out of bounds. |
| 315 | private drawFinderPattern(x: int, y: int): void { |
| 316 | for (let dy = -4; dy <= 4; dy++) { |
| 317 | for (let dx = -4; dx <= 4; dx++) { |
| 318 | const dist: int = Math.max(Math.abs(dx), Math.abs(dy)); // Chebyshev/infinity norm |
| 319 | const xx: int = x + dx; |
| 320 | const yy: int = y + dy; |
| 321 | if (0 <= xx && xx < this.size && 0 <= yy && yy < this.size) |
| 322 | this.setFunctionModule(xx, yy, dist != 2 && dist != 4); |
| 323 | } |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | |
| 328 | // Draws a 5*5 alignment pattern, with the center module |
no test coverage detected