TraceSpan? getHit(int x, int y) { if (x >= 0 && x < width && y >= 0 && y < height) { return grid[y * width + x]; } return null; }