[client] core: increase autoCapture false exit detection sensitivity

Mouse move deltas greater then 10 are rare, let alone the 20 this code
now uses. Any movements that exceed 20 pixels will disable the exit
detection code path preventing rapid movements in FPV games from causing
the cursor to exit the window if autoCapture is enabled.
This commit is contained in:
Geoffrey McRae 2021-02-23 20:04:15 +11:00
parent 78f4249496
commit a8ab559de0

View File

@ -393,7 +393,7 @@ void core_handleMouseNormal(double ex, double ey)
/* if we are in "autoCapture" and the delta was large don't test for exit */ /* if we are in "autoCapture" and the delta was large don't test for exit */
if (g_params.autoCapture && if (g_params.autoCapture &&
(fabs(ex) > 100.0 / g_cursor.scale.x || fabs(ey) > 100.0 / g_cursor.scale.y)) (fabs(ex) > 20.0 / g_cursor.scale.x || fabs(ey) > 20.0 / g_cursor.scale.y))
testExit = false; testExit = false;
/* if any buttons are held we should not allow exit to happen */ /* if any buttons are held we should not allow exit to happen */