From 0699ae161ff80d1f2294c7ec12e6a6e02c95b8b7 Mon Sep 17 00:00:00 2001 From: omar Date: Thu, 3 May 2018 21:49:38 +0200 Subject: [PATCH] DragInt, DragScalar: Actually made the fast-past handle the now-most-common case.. --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index bdb11ce1..22d77b2d 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -9320,7 +9320,7 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* v, floa const bool hovered = ItemHoverable(frame_bb, id); // Patch old "%.0f" format string to use "%d", read function comments for more details. - if (data_type == ImGuiDataType_S32) + if (data_type == ImGuiDataType_S32 && strcmp(format, "%d") != 0) format = (strcmp(format, "%.0f") == 0) ? "%d" : PatchFormatStringFloatToInt(format); // Tabbing or CTRL-clicking on Drag turns it into an input box