diff src/viewport_gui.cpp @ 17101:0c415ae476a0 draft

(svn r21838) -Change: allow LMB scrolling with the mouse outside of the extra viewport instead of canceling scrolling when going slightly over the edge
author rubidium <rubidium@openttd.org>
date Tue, 18 Jan 2011 21:09:13 +0000 (2011-01-18)
parents 35b2a62ecb1a
children c62cecf4dade
line wrap: on
line diff
--- a/src/viewport_gui.cpp
+++ b/src/viewport_gui.cpp
@@ -137,11 +137,8 @@
 
 	virtual void OnScroll(Point delta)
 	{
-		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);
+		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;
 	}