summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-03-02 18:01:33 +0000
committerrubidium <rubidium@openttd.org>2009-03-02 18:01:33 +0000
commit83888098dbe68fcc2eae7f0efe647b8da6405a00 (patch)
tree2a4109e93d56e13334aad20984a17876a4702bf0 /src
parent12e5355c7c4058700f12cda7b2c9648492673baf (diff)
downloadopenttd-83888098dbe68fcc2eae7f0efe647b8da6405a00.tar.xz
(svn r15598) -Fix [FS#2695]: crash when opening viewport while scrolling the map and the mouse 'lands' on the window decoration of the viewport.
Diffstat (limited to 'src')
-rw-r--r--src/smallmap_gui.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index f2ef2ee04..c113b4811 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -1176,12 +1176,8 @@ public:
virtual void OnScroll(Point delta)
{
- ViewPort *vp = IsPtInWindowViewport(this, _cursor.pos.x, _cursor.pos.y);
-
- if (vp == NULL) {
- _cursor.fix_at = false;
- _scrolling_viewport = false;
- }
+ const ViewPort *vp = IsPtInWindowViewport(this, _cursor.pos.x, _cursor.pos.y);
+ if (vp == NULL) return;
this->viewport->scrollpos_x += ScaleByZoom(delta.x, vp->zoom);
this->viewport->scrollpos_y += ScaleByZoom(delta.y, vp->zoom);