mail[Wesnoth-commits] r33444 - /trunk/src/controller_base.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by kailoran on March 08, 2009 - 18:14:
Author: ilor
Date: Sun Mar  8 18:14:44 2009
New Revision: 33444

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33444&view=rev
Log:
don't scroll the map if the mouse is within the scroll threshold but on a 
theme menu button

Modified:
    trunk/src/controller_base.cpp

Modified: trunk/src/controller_base.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/controller_base.cpp?rev=33444&r1=33443&r2=33444&view=diff
==============================================================================
--- trunk/src/controller_base.cpp (original)
+++ trunk/src/controller_base.cpp Sun Mar  8 18:14:44 2009
@@ -16,6 +16,7 @@
 #include "controller_base.hpp"
 #include "dialogs.hpp"
 #include "mouse_handler_base.hpp"
+#include "foreach.hpp"
 
 controller_base::controller_base(
                int ticks, const config& game_config, CVideo& /*video*/) :
@@ -130,10 +131,14 @@
        bool scrolling = false;
        bool mouse_in_window = (SDL_GetAppState() & SDL_APPMOUSEFOCUS)
         || utils::string_bool(preferences::get("scroll_when_mouse_outside"), 
true);
-       const int scroll_threshold = (preferences::mouse_scroll_enabled())
+       int scroll_threshold = (preferences::mouse_scroll_enabled())
                        ? preferences::mouse_scroll_threshold()
                        : 0;
-
+       foreach (const theme::menu& m, get_display().get_theme().menus()) {
+               if (point_in_rect(mousex, mousey, m.get_location())) {
+                       scroll_threshold = 0;
+               }
+       }
        if ((key[SDLK_UP] && have_keyboard_focus())
        || (mousey < scroll_threshold && mouse_in_window)) {
                get_display().scroll(0,-preferences::scroll_speed());




Related Messages


Powered by MHonArc, Updated Sun Mar 08 18:40:33 2009