diff --git a/third-party/imgui/imgui.cpp b/third-party/imgui/imgui.cpp index fcfb604890a..784bf96f059 100644 --- a/third-party/imgui/imgui.cpp +++ b/third-party/imgui/imgui.cpp @@ -6455,10 +6455,12 @@ bool ImGui::SliderBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v new_value = ImLerp(v_min, v_max, normalized_pos); } - // Round past decimal precision + // Round past decimal precision, verify that it remains within min/max range new_value = RoundScalar(new_value, decimal_precision); if (*v != new_value) { + if (new_value >v_max ) new_value = v_max; + if (new_value < v_min) new_value = v_min; *v = new_value; value_changed = true; }