clamp ride overview viewport zoom level to allowed range

This commit is contained in:
IntelOrca 2016-02-27 13:30:00 +00:00
parent d27c9c0ec4
commit 22a194ffa6
1 changed files with 2 additions and 1 deletions

View File

@ -1221,7 +1221,8 @@ static void window_ride_update_overall_view(uint8 ride_index) {
// Each farther zoom level shows twice as many tiles (log)
// Appropriate zoom is lowered by one to fill the entire view with the ride
view->zoom = (uint8) max(0, ceil(log(size / 80)) - 1);
double zoom = ceil(log(size / 80)) - 1;
view->zoom = (uint8)clamp(0, zoom, 3);
}
/**