summaryrefslogtreecommitdiff
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
commit3d75eb446d8795de5ec1d4a85d4efda86bcbd72c (patch)
tree91bc16f1ef01f0dd434409b8340abd236f1ff9d1
parent5a6f6bf067a22f4729f19c58ed3dfff9559b4956 (diff)
downloadopenttd-3d75eb446d8795de5ec1d4a85d4efda86bcbd72c.tar.xz
(svn r13346) -Fix (r13322): scrolling the main viewport with keyboard when having a build tool selected failed.
-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;