mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
[x11] Don't double-divide for window center
I obviously need a better way to test legacy code because the fix for unsigned-int behavior with clang broke mouse warping when using XGrabPointer instead of XInput2's XIGrabEnter.
This commit is contained in:
parent
65214fb7f8
commit
b553c313fe
1 changed files with 2 additions and 2 deletions
|
@ -836,8 +836,8 @@ event_motion (XEvent *event)
|
||||||
if (!event->xmotion.send_event) {
|
if (!event->xmotion.send_event) {
|
||||||
int center_x = viddef.width / 2;
|
int center_x = viddef.width / 2;
|
||||||
int center_y = viddef.height / 2;
|
int center_y = viddef.height / 2;
|
||||||
unsigned dist_x = abs (center_x / 2 - event->xmotion.x);
|
unsigned dist_x = abs (center_x - event->xmotion.x);
|
||||||
unsigned dist_y = abs (center_y / 2 - event->xmotion.y);
|
unsigned dist_y = abs (center_y - event->xmotion.y);
|
||||||
|
|
||||||
x11_mouse_axes[0].value = event->xmotion.x - x11_mouse.x;
|
x11_mouse_axes[0].value = event->xmotion.x - x11_mouse.x;
|
||||||
x11_mouse_axes[1].value = event->xmotion.y - x11_mouse.y;
|
x11_mouse_axes[1].value = event->xmotion.y - x11_mouse.y;
|
||||||
|
|
Loading…
Reference in a new issue