Author: alink
Date: Sun Apr  8 03:31:45 2007
New Revision: 16685

URL: http://svn.gna.org/viewcvs/wesnoth?rev=16685&view=rev
Log:
Starting to apply patch #644, Shift + mousewheel do a horizontal
scrolling. The previous strange horizontal scrolling system is removed.
I'm not sure about the shift key (seems to be a Mac standard), maybe alt
is better ?

Modified:
    trunk/src/mouse_events.cpp

Modified: trunk/src/mouse_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/mouse_events.cpp?rev=16685&r1=16684&r2=16685&view=diff
==============================================================================
--- trunk/src/mouse_events.cpp (original)
+++ trunk/src/mouse_events.cpp Sun Apr  8 03:31:45 2007
@@ -993,16 +993,14 @@
                const int speed = preferences::scroll_speed() *
                        (event.button == SDL_BUTTON_WHEELUP ? -1:1);
 
-               const int centerx = gui_->mapx()/2;
-               const int centery = gui_->y()/2;
-
-               const int xdisp = abs(centerx - event.x);
-               const int ydisp = abs(centery - event.y);
-
-               if(xdisp > ydisp)
+               struct CKey pressed;
+               // Shift + mousewheel do a horizontal scroll
+               // This emulates normal-outside-of-SDL Mac OS X behavior
+               if (pressed[SDLK_LSHIFT] || pressed[SDLK_RSHIFT])
                        gui_->scroll(speed,0);
                else
                        gui_->scroll(0,speed);
+       
                mouse_update(browse);
        }
        if (!dragging_ && dragging_started_) {


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to