From cc9ffd1e60a2e32b54d04990fc4f86739a6ad619 Mon Sep 17 00:00:00 2001 From: Allanis Date: Fri, 19 Apr 2013 20:22:04 +0100 Subject: [PATCH] [Add] Support for mousewheel to zoom in/out of map. --- src/map.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/map.c b/src/map.c index d368ad8..ba56538 100644 --- a/src/map.c +++ b/src/map.c @@ -219,6 +219,11 @@ static void map_mouse(SDL_Event* event, double mx, double my) { switch(event->type) { case SDL_MOUSEBUTTONDOWN: + if(event->button.button == SDL_BUTTON_WHEELUP) + map_buttonZoom("btnZoomOut"); + else if(event->button.button == SDL_BUTTON_WHEELDOWN) + map_buttonZoom("btnZoomIn"); + // Selecting star system. for(i = 0; i < systems_nstack; i++) { x = systems_stack[i].pos.x * map_zoom;