From 48d35a319910df45330b42904b88832ffab08a55 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Tue, 28 Feb 2017 19:12:22 +1100 Subject: [PATCH] Don't handle mousewheel scrolling if mouse is not in game map area (bug #24501) --- src/mouse_handler_base.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mouse_handler_base.cpp b/src/mouse_handler_base.cpp index eb07a3ca6d0f..5f5778cebc92 100644 --- a/src/mouse_handler_base.cpp +++ b/src/mouse_handler_base.cpp @@ -263,6 +263,11 @@ void mouse_handler_base::mouse_wheel(int scrollx, int scrolly, bool browse) movex = 0; movey = 0; } + // Don't scroll map if cursor is not in gamemap area + if(!sdl::point_in_rect(x, y, gui().map_area())) { + return; + } + if (movex != 0 || movey != 0) { CKey pressed; // Alt + mousewheel do an 90° rotation on the scroll direction