changeset 13511:4edbe8b91dd7 draft

(svn r18030) -Fix: screen jumped a bit for at least SDL and Allegro when right-click-dragging
author rubidium <rubidium@openttd.org>
date Mon, 09 Nov 2009 16:05:24 +0000
parents 091cfcac3066
children 6bfef66aa2b7
files src/smallmap_gui.cpp src/video/win32_v.cpp src/window.cpp
diffstat 3 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -1064,8 +1064,6 @@
 		if (widget == SM_WIDGET_MAP) {
 			if (_scrolling_viewport) return;
 			_scrolling_viewport = true;
-			_cursor.delta.x = 0;
-			_cursor.delta.y = 0;
 		}
 	}
 
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -879,7 +879,6 @@
 			if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged();
 
 			GameLoop();
-			_cursor.delta.x = _cursor.delta.y = 0;
 
 			if (_force_full_redraw) MarkWholeScreenDirty();
 
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -2197,7 +2197,7 @@
 	}
 }
 
-void MouseLoop(MouseClick click, int mousewheel)
+static void MouseLoop(MouseClick click, int mousewheel)
 {
 	DecreaseWindowCounters();
 	HandlePlacePresize();
@@ -2340,6 +2340,11 @@
 	}
 
 	MouseLoop(click, mousewheel);
+
+	/* We have moved the mouse the required distance,
+	 * no need to move it at any later time. */
+	_cursor.delta.x = 0;
+	_cursor.delta.y = 0;
 }
 
 /**