[client] egl: clamp sharpness settings in filters

While the slider does not allow you to get out of range by dragging,
the user could still type in out of range values, so we clamp the values.
This commit is contained in:
Quantum 2021-08-14 22:28:32 -04:00 committed by Geoffrey McRae
parent 36073586e7
commit 8f5afe1848
2 changed files with 2 additions and 0 deletions

View File

@ -177,6 +177,7 @@ static bool egl_filterFFXCASImguiConfig(EGL_Filter * filter)
igGetStyle()->WindowPadding.x);
igSliderFloat("##casSharpness", &casSharpness, 0.0f, 1.0f, NULL, 0);
casSharpness = util_clamp(casSharpness, 0.0f, 1.0f);
if (igIsItemHovered(ImGuiHoveredFlags_None))
igSetTooltip("Ctrl+Click to enter a value");
igPopItemWidth();

View File

@ -280,6 +280,7 @@ static bool egl_filterFFXFSR1ImguiConfig(EGL_Filter * filter)
igPushItemWidth(igGetWindowWidth() - igGetCursorPosX() -
igGetStyle()->WindowPadding.x);
igSliderFloat("##fsr1Sharpness", &sharpness, 0.0f, 1.0f, NULL, 0);
sharpness = util_clamp(sharpness, 0.0f, 1.0f);
if (igIsItemHovered(ImGuiHoveredFlags_None))
igSetTooltip("Ctrl+Click to enter a value");
igPopItemWidth();