src/events/SDL_mouse.c
changeset 9448 3d3ed3a5ba8d
parent 9334 5eb5ab33286e
child 9619 b94b6d0bff0f
--- a/src/events/SDL_mouse.c	Sat Mar 28 00:48:03 2015 -0400
+++ b/src/events/SDL_mouse.c	Mon Mar 30 11:31:53 2015 -0700
@@ -293,9 +293,14 @@
         event.motion.yrel = yrel;
         posted = (SDL_PushEvent(&event) > 0);
     }
-    /* Use unclamped values if we're getting events outside the window */
-    mouse->last_x = x;
-    mouse->last_y = y;
+    if (relative) {
+        mouse->last_x = mouse->x;
+        mouse->last_y = mouse->y;
+    } else {
+        /* Use unclamped values if we're getting events outside the window */
+        mouse->last_x = x;
+        mouse->last_y = y;
+    }
     return posted;
 }