summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-01-22 14:51:36 +0000
committerrubidium <rubidium@openttd.org>2011-01-22 14:51:36 +0000
commit849772f0fd50fdbbc6eb46625a19f1c0602d4517 (patch)
treef8eb07ac57d8f197aee32240a55da799913e202f /src
parent9e8db65223bf91ad26d2f54ef115d773bbb4f63a (diff)
downloadopenttd-849772f0fd50fdbbc6eb46625a19f1c0602d4517.tar.xz
(svn r21889) -Fix [FS#4434]: crash when scrolling outside of the main window (with some video backends)
Diffstat (limited to 'src')
-rw-r--r--src/main_gui.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index e572ea301..e12f417e8 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -413,15 +413,8 @@ struct MainWindow : Window
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;
- }
-
- this->viewport->scrollpos_x += ScaleByZoom(delta.x, vp->zoom);
- this->viewport->scrollpos_y += ScaleByZoom(delta.y, vp->zoom);
+ this->viewport->scrollpos_x += ScaleByZoom(delta.x, this->viewport->zoom);
+ this->viewport->scrollpos_y += ScaleByZoom(delta.y, this->viewport->zoom);
this->viewport->dest_scrollpos_x = this->viewport->scrollpos_x;
this->viewport->dest_scrollpos_y = this->viewport->scrollpos_y;
}