mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 06:15:04 +00:00
(svn r13346) -Fix (r13322): scrolling the main viewport with keyboard when having a build tool selected failed.
This commit is contained in:
parent
5a6f6bf067
commit
3d75eb446d
@ -1796,14 +1796,12 @@ static const int8 scrollamt[16][2] = {
|
|||||||
{ 0, 0}, ///< 15 : left + up + right + down = nothing
|
{ 0, 0}, ///< 15 : left + up + right + down = nothing
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool HandleKeyScrolling()
|
static void HandleKeyScrolling()
|
||||||
{
|
{
|
||||||
if (_dirkeys && !_no_scroll) {
|
if (_dirkeys && !_no_scroll) {
|
||||||
int factor = _shift_pressed ? 50 : 10;
|
int factor = _shift_pressed ? 50 : 10;
|
||||||
ScrollMainViewport(scrollamt[_dirkeys][0] * factor, scrollamt[_dirkeys][1] * factor);
|
ScrollMainViewport(scrollamt[_dirkeys][0] * factor, scrollamt[_dirkeys][1] * factor);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MouseLoop(MouseClick click, int mousewheel)
|
void MouseLoop(MouseClick click, int mousewheel)
|
||||||
@ -1811,13 +1809,14 @@ void MouseLoop(MouseClick click, int mousewheel)
|
|||||||
DecreaseWindowCounters();
|
DecreaseWindowCounters();
|
||||||
HandlePlacePresize();
|
HandlePlacePresize();
|
||||||
UpdateTileSelection();
|
UpdateTileSelection();
|
||||||
|
HandleKeyScrolling();
|
||||||
|
|
||||||
if (!VpHandlePlaceSizingDrag()) return;
|
if (!VpHandlePlaceSizingDrag()) return;
|
||||||
if (!HandleDragDrop()) return;
|
if (!HandleDragDrop()) return;
|
||||||
if (!HandleWindowDragging()) return;
|
if (!HandleWindowDragging()) return;
|
||||||
if (!HandleScrollbarScrolling()) return;
|
if (!HandleScrollbarScrolling()) return;
|
||||||
if (!HandleViewportScroll()) return;
|
if (!HandleViewportScroll()) return;
|
||||||
if (!HandleMouseOver()) return;
|
if (!HandleMouseOver()) return;
|
||||||
if (!HandleKeyScrolling()) return;
|
|
||||||
|
|
||||||
bool scrollwheel_scrolling = _settings_client.gui.scrollwheel_scrolling == 1 && (_cursor.v_wheel != 0 || _cursor.h_wheel != 0);
|
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;
|
if (click == MC_NONE && mousewheel == 0 && !scrollwheel_scrolling) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user