From dac7516fdc9659bf3224eda8269eade89db679c9 Mon Sep 17 00:00:00 2001 From: DimaKoltun <83829508+DimaKoltun@users.noreply.github.com> Date: Mon, 9 Sep 2024 11:26:07 +0300 Subject: [PATCH] Update imgui_widgets.cpp --- imgui_widgets.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index bffdc22b4..9cc4e4507 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -2296,7 +2296,7 @@ bool ImGui::DataTypeApplyFromText(const char* buf, ImGuiDataType data_type, void template static int DataTypeCompareT(const T* lhs, const T* rhs) { - if (*lhs <= *rhs) return -1; + if (*lhs < *rhs) return -1; if (*lhs > *rhs) return +1; return 0; } @@ -2632,7 +2632,7 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data, if (temp_input_is_active) { // Only clamp CTRL+Click input when ImGuiSliderFlags_AlwaysClamp is set - const bool is_clamp_input = (flags & ImGuiSliderFlags_AlwaysClamp) != 0 && (p_min == NULL || p_max == NULL || DataTypeCompare(data_type, p_min, p_max) < 0); + const bool is_clamp_input = (flags & ImGuiSliderFlags_AlwaysClamp) != 0 && (p_min == NULL || p_max == NULL || DataTypeCompare(data_type, p_min, p_max) <= 0); return TempInputScalar(frame_bb, id, label, data_type, p_data, format, is_clamp_input ? p_min : NULL, is_clamp_input ? p_max : NULL); }