mirror of
https://github.com/libretro/RetroArch
synced 2025-02-07 12:39:54 +00:00
clamp axis_threshold to avoid potential floating point issues.
This commit is contained in:
parent
765e876cc4
commit
9e865d22c9
@ -2659,17 +2659,16 @@ static int menu_common_setting_set(void *data, unsigned setting, unsigned action
|
||||
|
||||
case RGUI_ACTION_OK:
|
||||
case RGUI_ACTION_RIGHT:
|
||||
if (g_settings.input.axis_threshold < 1.0)
|
||||
g_settings.input.axis_threshold += 0.001;
|
||||
g_settings.input.axis_threshold += 0.01;
|
||||
break;
|
||||
case RGUI_ACTION_LEFT:
|
||||
if (g_settings.input.axis_threshold > 0.0)
|
||||
g_settings.input.axis_threshold -= 0.001;
|
||||
g_settings.input.axis_threshold -= 0.01;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
g_settings.input.axis_threshold = max(min(g_settings.input.axis_threshold, 0.95f), 0.05f);
|
||||
break;
|
||||
case RGUI_SETTINGS_BIND_DEVICE_TYPE:
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user