summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-02-12 23:26:19 +0100
committerGitHub <noreply@github.com>2017-02-12 23:26:19 +0100
commit3cab47adba089560ca0f76ba936967c7c8da5bd8 (patch)
tree98d550a860a1ac304913275cc3165c543446667a /platform
parent73cedc3901a86f9b4a9b4caecff9019fdd497296 (diff)
parent523b69771b16cddc4635aa4a5c2d56cefec1d394 (diff)
Merge pull request #7782 from SaracenOne/windows_relative_cursor_fix
Fix relative cursor data in CAPTURED mouse mode on Windows.
Diffstat (limited to 'platform')
-rw-r--r--platform/windows/os_windows.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index b39d6f664f..1e51c18b63 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -400,14 +400,15 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) {
if (mouse_mode==MOUSE_MODE_CAPTURED) {
Point2i c(video_mode.width/2,video_mode.height/2);
+ old_x = c.x;
+ old_y = c.y;
+
if (Point2i(mm.x,mm.y)==c) {
center=c;
return 0;
}
Point2i ncenter(mm.x,mm.y);
- mm.x = old_x + (mm.x-center.x);
- mm.y = old_y + (mm.y-center.y);
center=ncenter;
POINT pos = { (int) c.x, (int) c.y };
ClientToScreen(hWnd, &pos);