From 2e6bfd6a4de6b675ace3d5c49dd5f8967350380b Mon Sep 17 00:00:00 2001 From: Allanis Date: Sun, 10 Mar 2013 19:13:17 +0000 Subject: [PATCH] [Change] Resizing starmap works at different speeds. --- src/map.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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); + } }