summaryrefslogtreecommitdiff
path: root/src/smallmap_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-02-05 16:36:37 +0000
committerfrosch <frosch@openttd.org>2011-02-05 16:36:37 +0000
commit9e1695aa1e8079fc46d05af25a26917cfd678deb (patch)
treecebc4f0862fc6eced4a29f95b45a63d039522073 /src/smallmap_gui.cpp
parentb992a939966dfe50e16688d1f30767a50b2d2bc5 (diff)
downloadopenttd-9e1695aa1e8079fc46d05af25a26917cfd678deb.tar.xz
(svn r21977) -Codechange: Always cal Window::OnMouseWheel(), independent of viewport scroll/zoom settings.
Diffstat (limited to 'src/smallmap_gui.cpp')
-rw-r--r--src/smallmap_gui.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index 576abd3d2..7cc9f540f 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -1461,12 +1461,14 @@ public:
virtual void OnMouseWheel(int wheel)
{
- const NWidgetBase *wid = this->GetWidget<NWidgetBase>(SM_WIDGET_MAP);
- int cursor_x = _cursor.pos.x - this->left - wid->pos_x;
- int cursor_y = _cursor.pos.y - this->top - wid->pos_y;
- if (IsInsideMM(cursor_x, 0, wid->current_x) && IsInsideMM(cursor_y, 0, wid->current_y)) {
- Point pt = {cursor_x, cursor_y};
- this->SetZoomLevel((wheel < 0) ? ZLC_ZOOM_IN : ZLC_ZOOM_OUT, &pt);
+ if (_settings_client.gui.scrollwheel_scrolling == 0) {
+ const NWidgetBase *wid = this->GetWidget<NWidgetBase>(SM_WIDGET_MAP);
+ int cursor_x = _cursor.pos.x - this->left - wid->pos_x;
+ int cursor_y = _cursor.pos.y - this->top - wid->pos_y;
+ if (IsInsideMM(cursor_x, 0, wid->current_x) && IsInsideMM(cursor_y, 0, wid->current_y)) {
+ Point pt = {cursor_x, cursor_y};
+ this->SetZoomLevel((wheel < 0) ? ZLC_ZOOM_IN : ZLC_ZOOM_OUT, &pt);
+ }
}
}