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
commitb1c105e77eba857bbb1368f6748a496c703a62d2 (patch)
tree2a4109e93d56e13334aad20984a17876a4702bf0 /src
parentf5a07faf871d5b0ff3920d40c72570bc66bfdbed (diff)
downloadopenttd-b1c105e77eba857bbb1368f6748a496c703a62d2.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);