Mercurial > hg > openttd
changeset 17151:f89e4ac875e8 draft
(svn r21889) -Fix [FS#4434]: crash when scrolling outside of the main window (with some video backends)
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sat, 22 Jan 2011 14:51:36 +0000 |
parents | 47d33cf95c70 |
children | c62cecf4dade |
files | src/main_gui.cpp |
diffstat | 1 files changed, 2 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -413,15 +413,8 @@ 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; }