From 7b22a91578800e115b5d3feacaa89707d80ab788 Mon Sep 17 00:00:00 2001 From: omar Date: Thu, 1 Feb 2018 00:08:13 +0100 Subject: [PATCH] Nav / Slider: Fixed reaching edge of integer slider with navigation input, bug introduced on January 25 in Nav branch 10a4a77b27d598bf10fb617e4180488eaf0adc2a. (#787) --- imgui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index ac12e3ff..ebbd7522 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -8457,10 +8457,11 @@ bool ImGui::SliderBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v } if (IsNavInputDown(ImGuiNavInput_PadTweakFast)) delta *= 10.0f; - clicked_t = ImSaturate(clicked_t + delta); set_new_value = true; if ((clicked_t >= 1.0f && delta > 0.0f) || (clicked_t <= 0.0f && delta < 0.0f)) // This is to avoid applying the saturation when already past the limits set_new_value = false; + else + clicked_t = ImSaturate(clicked_t + delta); } } else