From 980a5b503fdbeeae4317bfde9d980e7eaca50eaa Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Sat, 31 Aug 2019 19:55:02 +0300 Subject: [PATCH] Fixed two-finger scrolling --- src/window.cpp | 9 ++++++--- todo.txt | 2 -- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/window.cpp b/src/window.cpp index aef4a9e120..3adac69fae 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2676,7 +2676,10 @@ static EventState HandleViewportScroll() * outside of the window and should not left-mouse scroll anymore. */ if (_last_scroll_window == NULL) _last_scroll_window = FindWindowFromPt(_cursor.pos.x, _cursor.pos.y); - if (_last_scroll_window == NULL || !((_settings_client.gui.scroll_mode != VSM_MAP_LMB && _right_button_down) || scrollwheel_scrolling || ((_move_pressed || _settings_client.gui.scroll_mode == VSM_MAP_LMB) && _left_button_down))) { + if (_last_scroll_window == NULL || !( + (_settings_client.gui.scroll_mode != VSM_MAP_LMB && _right_button_down) || + scrollwheel_scrolling || + ((_move_pressed || _settings_client.gui.scroll_mode == VSM_MAP_LMB) && (_left_button_down || _right_button_down)))) { _cursor.fix_at = false; _scrolling_viewport = false; _last_scroll_window = NULL; @@ -3166,8 +3169,8 @@ static void MouseLoop(MouseClick click, int mousewheel) return; case MC_RIGHT: - if (!(w->flags & WF_DISABLE_VP_SCROLL) && - _settings_client.gui.scroll_mode != VSM_MAP_LMB) { + if (!(w->flags & WF_DISABLE_VP_SCROLL)) { + printf("RMB scroll start\n"); _scrolling_viewport = true; _cursor.fix_at = (_settings_client.gui.scroll_mode == VSM_VIEWPORT_RMB_FIXED || _settings_client.gui.scroll_mode == VSM_MAP_RMB_FIXED); diff --git a/todo.txt b/todo.txt index 949fc6198e..e3d30d364a 100644 --- a/todo.txt +++ b/todo.txt @@ -11,5 +11,3 @@ - Select native screen width x 480 resolution on first run. -- Two-finger scroll when building road is broken. -