summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-30 21:06:43 +0000
committerrubidium <rubidium@openttd.org>2008-05-30 21:06:43 +0000
commit224ca68fb53ea1f500ff38c7326f2cc1202997be (patch)
tree91bc16f1ef01f0dd434409b8340abd236f1ff9d1 /src
parent20228809f069406ec7227c54513ae1b15a0a8ec4 (diff)
downloadopenttd-224ca68fb53ea1f500ff38c7326f2cc1202997be.tar.xz
(svn r13346) -Fix (r13322): scrolling the main viewport with keyboard when having a build tool selected failed.
Diffstat (limited to 'src')
-rw-r--r--src/window.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/window.cpp b/src/window.cpp
index a49eae865..9ac86b2e7 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1796,14 +1796,12 @@ static const int8 scrollamt[16][2] = {
{ 0, 0}, ///< 15 : left + up + right + down = nothing
};
-static bool HandleKeyScrolling()
+static void HandleKeyScrolling()
{
if (_dirkeys && !_no_scroll) {
int factor = _shift_pressed ? 50 : 10;
ScrollMainViewport(scrollamt[_dirkeys][0] * factor, scrollamt[_dirkeys][1] * factor);
- return false;
}
- return true;
}
void MouseLoop(MouseClick click, int mousewheel)
@@ -1811,13 +1809,14 @@ void MouseLoop(MouseClick click, int mousewheel)
DecreaseWindowCounters();
HandlePlacePresize();
UpdateTileSelection();
+ HandleKeyScrolling();
+
if (!VpHandlePlaceSizingDrag()) return;
if (!HandleDragDrop()) return;
if (!HandleWindowDragging()) return;
if (!HandleScrollbarScrolling()) return;
if (!HandleViewportScroll()) return;
if (!HandleMouseOver()) return;
- if (!HandleKeyScrolling()) return;
bool scrollwheel_scrolling = _settings_client.gui.scrollwheel_scrolling == 1 && (_cursor.v_wheel != 0 || _cursor.h_wheel != 0);
if (click == MC_NONE && mousewheel == 0 && !scrollwheel_scrolling) return;