Changeset - r17141:77cef47d686e
[Not reviewed]
master
0 1 0
rubidium - 13 years ago 2011-01-22 14:51:36
rubidium@openttd.org
(svn r21889) -Fix [FS#4434]: crash when scrolling outside of the main window (with some video backends)
1 file changed with 2 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/main_gui.cpp
Show inline comments
 
@@ -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;
 
	}
0 comments (0 inline, 0 general)