diff --git a/src/map.c b/src/map.c index 282a494..ed65a8e 100644 --- a/src/map.c +++ b/src/map.c @@ -256,9 +256,14 @@ static void map_mouse(SDL_Event* event, double mx, double my) { } static void map_buttonZoom(char* str) { - if(strcmp(str, "btnZoomIn")==0) - map_zoom = MIN(2., map_zoom+0.5); - else if(strcmp(str, "btnZoomOut")==0) - map_zoom = MAX(0.5, map_zoom-0.5); + if(strcmp(str, "btnZoomIn")==0) { + map_zoom += (map_zoom >= 1.) ? 0.5 : 0.25; + map_zoom = MIN(2.5, map_zoom); + } + + else if(strcmp(str, "btnZoomOut")==0) { + map_zoom -= (map_zoom > 1.) ? 0.5 : 0.25; + map_zoom = MAX(0.5, map_zoom); + } }