mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 13:37:22 +00:00
[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:
parent
36073586e7
commit
8f5afe1848
@ -177,6 +177,7 @@ static bool egl_filterFFXCASImguiConfig(EGL_Filter * filter)
|
|||||||
igGetStyle()->WindowPadding.x);
|
igGetStyle()->WindowPadding.x);
|
||||||
|
|
||||||
igSliderFloat("##casSharpness", &casSharpness, 0.0f, 1.0f, NULL, 0);
|
igSliderFloat("##casSharpness", &casSharpness, 0.0f, 1.0f, NULL, 0);
|
||||||
|
casSharpness = util_clamp(casSharpness, 0.0f, 1.0f);
|
||||||
if (igIsItemHovered(ImGuiHoveredFlags_None))
|
if (igIsItemHovered(ImGuiHoveredFlags_None))
|
||||||
igSetTooltip("Ctrl+Click to enter a value");
|
igSetTooltip("Ctrl+Click to enter a value");
|
||||||
igPopItemWidth();
|
igPopItemWidth();
|
||||||
|
@ -280,6 +280,7 @@ static bool egl_filterFFXFSR1ImguiConfig(EGL_Filter * filter)
|
|||||||
igPushItemWidth(igGetWindowWidth() - igGetCursorPosX() -
|
igPushItemWidth(igGetWindowWidth() - igGetCursorPosX() -
|
||||||
igGetStyle()->WindowPadding.x);
|
igGetStyle()->WindowPadding.x);
|
||||||
igSliderFloat("##fsr1Sharpness", &sharpness, 0.0f, 1.0f, NULL, 0);
|
igSliderFloat("##fsr1Sharpness", &sharpness, 0.0f, 1.0f, NULL, 0);
|
||||||
|
sharpness = util_clamp(sharpness, 0.0f, 1.0f);
|
||||||
if (igIsItemHovered(ImGuiHoveredFlags_None))
|
if (igIsItemHovered(ImGuiHoveredFlags_None))
|
||||||
igSetTooltip("Ctrl+Click to enter a value");
|
igSetTooltip("Ctrl+Click to enter a value");
|
||||||
igPopItemWidth();
|
igPopItemWidth();
|
||||||
|
Loading…
Reference in New Issue
Block a user