Skip to content

Commit

Permalink
Fixed relative mouse motion moving farther and farther off screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Mar 30, 2015
1 parent a0e878a commit 236deab
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/events/SDL_mouse.c
Expand Up @@ -293,9 +293,14 @@ SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relativ
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;
}

Expand Down

0 comments on commit 236deab

Please sign in to comment.