summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Weiss <ik@alexanderweiss.nl>2018-04-28 00:12:49 +0200
committerMichael Lutz <michi@icosahedron.de>2018-05-24 21:31:37 +0200
commite1a164b5316a6242d69d56b53c9df19edb9d279f (patch)
treed818e4d7ff211cd34cb458099be113b31ba2ea9a
parent6df7ced343deb150323f709822b5fde1e8fe1d97 (diff)
downloadopenttd-e1a164b5316a6242d69d56b53c9df19edb9d279f.tar.xz
Change: [OSX] Setting mouse-wheel to scroll the map does not disable pinch to zoom
-rw-r--r--src/main_gui.cpp2
-rw-r--r--src/smallmap_gui.cpp2
-rw-r--r--src/viewport_gui.cpp2
-rw-r--r--src/window.cpp4
4 files changed, 5 insertions, 5 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index b13920a64..199546d43 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -439,7 +439,7 @@ struct MainWindow : Window
virtual void OnMouseWheel(int wheel)
{
- if (_settings_client.gui.scrollwheel_scrolling == 0) {
+ if (_settings_client.gui.scrollwheel_scrolling != 2) {
ZoomInOrOutToCursorWindow(wheel < 0, this);
}
}
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index 6b234ee90..7e3e75953 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -1559,7 +1559,7 @@ int SmallMapWindow::GetPositionOnLegend(Point pt)
/* virtual */ void SmallMapWindow::OnMouseWheel(int wheel)
{
- if (_settings_client.gui.scrollwheel_scrolling == 0) {
+ if (_settings_client.gui.scrollwheel_scrolling != 2) {
const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_SM_MAP);
int cursor_x = _cursor.pos.x - this->left - wid->pos_x;
int cursor_y = _cursor.pos.y - this->top - wid->pos_y;
diff --git a/src/viewport_gui.cpp b/src/viewport_gui.cpp
index cbd300dec..9c89a85f8 100644
--- a/src/viewport_gui.cpp
+++ b/src/viewport_gui.cpp
@@ -138,7 +138,7 @@ public:
virtual void OnMouseWheel(int wheel)
{
- if (_settings_client.gui.scrollwheel_scrolling == 0) {
+ if (_settings_client.gui.scrollwheel_scrolling != 2) {
ZoomInOrOutToCursorWindow(wheel < 0, this);
}
}
diff --git a/src/window.cpp b/src/window.cpp
index 30c1b8705..f17fccf93 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -2858,8 +2858,8 @@ static void MouseLoop(MouseClick click, int mousewheel)
if (vp != NULL && (_game_mode == GM_MENU || HasModalProgress())) return;
if (mousewheel != 0) {
- /* Send mousewheel event to window */
- w->OnMouseWheel(mousewheel);
+ /* Send mousewheel event to window, unless we're scrolling a viewport or the map */
+ if (!scrollwheel_scrolling || (vp == NULL && w->window_class != WC_SMALLMAP)) w->OnMouseWheel(mousewheel);
/* Dispatch a MouseWheelEvent for widgets if it is not a viewport */
if (vp == NULL) DispatchMouseWheelEvent(w, w->nested_root->GetWidgetFromPos(x - w->left, y - w->top), mousewheel);