diff --git a/src/imgui/imgui_widgets.cpp b/src/imgui/imgui_widgets.cpp index 5c7560efb..76103daae 100644 --- a/src/imgui/imgui_widgets.cpp +++ b/src/imgui/imgui_widgets.cpp @@ -41,7 +41,7 @@ Index of this file: #include "imgui_internal.h" #include - +#include // System includes #include // toupper #if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier @@ -3070,6 +3070,7 @@ bool ImGui::BBLDragFloat(const char *label, float *v, float v_speed, float v_min ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.00f, 0.68f, 0.26f, 0.00f)); ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.00f, 0.68f, 0.26f, 0.00f)); bool bbl_drag_scalar = BBLDragScalar(label, ImGuiDataType_Float, v, v_speed, &v_min, &v_max, format, flags); + *v = std::clamp(*v, v_min, v_max); ImGui::PopStyleColor(3); return bbl_drag_scalar; }