# HG changeset patch # User rubidium # Date 2009-11-09 16:05:24 # Node ID 4fc033860b44018971a54982ad8ce1e4aaae2f19 # Parent e02fc48dfb2ef1b72682fba88ea15dc48c5295f5 (svn r18030) -Fix: screen jumped a bit for at least SDL and Allegro when right-click-dragging diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1064,8 +1064,6 @@ public: if (widget == SM_WIDGET_MAP) { if (_scrolling_viewport) return; _scrolling_viewport = true; - _cursor.delta.x = 0; - _cursor.delta.y = 0; } } diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -879,7 +879,6 @@ void VideoDriver_Win32::MainLoop() if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged(); GameLoop(); - _cursor.delta.x = _cursor.delta.y = 0; if (_force_full_redraw) MarkWholeScreenDirty(); diff --git a/src/window.cpp b/src/window.cpp --- a/src/window.cpp +++ b/src/window.cpp @@ -2197,7 +2197,7 @@ static void HandleKeyScrolling() } } -void MouseLoop(MouseClick click, int mousewheel) +static void MouseLoop(MouseClick click, int mousewheel) { DecreaseWindowCounters(); HandlePlacePresize(); @@ -2340,6 +2340,11 @@ void HandleMouseEvents() } 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; } /**