changeset 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
parents ab7b8e1e4f3b
children 04d7d238167c
files src/viewport_gui.cpp
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
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;
 	}