fix crash when zomming in main menu

This commit is contained in:
Jérémy Rosen 2006-01-13 09:16:42 +00:00
parent 6c9ff35b70
commit 840571698f
2 changed files with 2 additions and 0 deletions

View file

@ -46,6 +46,7 @@ SVN trunk (1.1+svn):
* improved (underwater) merfolk village
* (internal) make attack animations work like all other animations
* backport latest SDL_ttf change, fix ascender/descender issue for DejaVu
* fix crash when using zoom keys in the main lobby
Version 1.1:
* campaign server

View file

@ -63,6 +63,7 @@ namespace {
int MinZoom(const gamemap& map, const SDL_Rect& viewport)
{
if(map.x()<4 || !map.y() ) return DefaultZoom;
const int min_zoom1 = viewport.w/((map.x()*3)/4);
const int min_zoom2 = viewport.h/map.y();
return maximum<int>(min_zoom1,min_zoom2);