diff options
author | rubidium <rubidium@openttd.org> | 2009-01-02 22:42:05 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-01-02 22:42:05 +0000 |
commit | 1357b0a4c2c9cb2cf6d81a2cbc3e851d25c6c735 (patch) | |
tree | f69215ca7fcf8c6741e37e05e4a9c67f0e8e201a /src/window.cpp | |
parent | 2086fbcf174b20758cbd9ebb94b3985e2b25ee29 (diff) | |
download | openttd-1357b0a4c2c9cb2cf6d81a2cbc3e851d25c6c735.tar.xz |
(svn r14789) -Feature: allow scrolling with the left mouse button pressed (if enabled). Primarily useful for systems with touch screen (aapo)
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/window.cpp b/src/window.cpp index 8b4d92ba2..c0911561c 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1581,7 +1581,7 @@ static bool HandleViewportScroll() Window *w = FindWindowFromPt(_cursor.pos.x, _cursor.pos.y); - if (!(_right_button_down || scrollwheel_scrolling) || w == NULL) { + if (!(_right_button_down || scrollwheel_scrolling || (_settings_client.gui.left_mouse_btn_scrolling && _left_button_down)) || w == NULL) { _cursor.fix_at = false; _scrolling_viewport = false; return true; @@ -1595,7 +1595,7 @@ static bool HandleViewportScroll() } Point delta; - if (_settings_client.gui.reverse_scroll) { + if (_settings_client.gui.reverse_scroll || (_settings_client.gui.left_mouse_btn_scrolling && _left_button_down)) { delta.x = -_cursor.delta.x; delta.y = -_cursor.delta.y; } else { @@ -1915,7 +1915,12 @@ void MouseLoop(MouseClick click, int mousewheel) } if (_thd.place_mode == VHM_NONE) { - HandleViewportClicked(vp, x, y); + if (!HandleViewportClicked(vp, x, y) && + !(w->flags4 & WF_DISABLE_VP_SCROLL) && + _settings_client.gui.left_mouse_btn_scrolling) { + _scrolling_viewport = true; + _cursor.fix_at = false; + } } else { PlaceObject(); } |