From 8f5afe18482019dbf29896c4d242baebd22bcca1 Mon Sep 17 00:00:00 2001 From: Quantum Date: Sat, 14 Aug 2021 22:28:32 -0400 Subject: [PATCH] [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. --- client/renderers/EGL/filter_ffx_cas.c | 1 + client/renderers/EGL/filter_ffx_fsr1.c | 1 + 2 files changed, 2 insertions(+) diff --git a/client/renderers/EGL/filter_ffx_cas.c b/client/renderers/EGL/filter_ffx_cas.c index a486f74c..95024bc7 100644 --- a/client/renderers/EGL/filter_ffx_cas.c +++ b/client/renderers/EGL/filter_ffx_cas.c @@ -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(); diff --git a/client/renderers/EGL/filter_ffx_fsr1.c b/client/renderers/EGL/filter_ffx_fsr1.c index 0241e9f6..dc26ec80 100644 --- a/client/renderers/EGL/filter_ffx_fsr1.c +++ b/client/renderers/EGL/filter_ffx_fsr1.c @@ -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();