(svn r19041) -Codechange: Improve selection of tile to draw in zoomed-out smallmaps.

This commit is contained in:
alberth
2010-02-06 13:19:46 +00:00
parent 21589daea9
commit a6e8c747c9
3 changed files with 70 additions and 11 deletions

View File

@@ -95,3 +95,13 @@ bool TileArea::Intersects(const TileArea &ta) const
);
}
/**
* Clamp the tile area to map borders.
*/
void TileArea::ClampToMap()
{
assert(this->tile < MapSize());
this->w = min(this->w, MapSizeX() - TileX(this->tile));
this->h = min(this->h, MapSizeY() - TileY(this->tile));
}