&& posy <= y_max) {
// tile is visible
Tile tile = getTile(tilex, tiley, zoom);
if (tile != null) {
painted = true;
tile.paint(g, posx, posy);
if (tileGridVisible) {
g.drawString(tile.getXtile() + ", "
+ tile.getYtile(), posx, posy + 12);
g.drawRect(posx, posy, Tile.SIZE, Tile.SIZE);
}