[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 authored and Geoffrey McRae committed 2021-08-15 18:01:03 +10:00
1 parent 36073586e7
commit 8f5afe1848
2 files changed
+2

No files matched your search

+1
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();
+1
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();