From 34d372279983308c44bb2e6466a22e4f106b68bf Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Fri, 20 Oct 2023 15:19:06 +0800 Subject: [PATCH] FIX:fix BBLDragFloat api Jira: STUDIO-4870 Change-Id: I53f1fca3a701b5a5cd28d12d954b050e69ed260f --- src/imgui/imgui_widgets.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }