Просмотр исходного кода

DragInt, DragScalar: Actually made the fast-past handle the now-most-common case..

omar 7 лет назад
Родитель
Сommit
0699ae161f
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      imgui.cpp

+ 1 - 1
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);
     const bool hovered = ItemHoverable(frame_bb, id);
 
 
     // Patch old "%.0f" format string to use "%d", read function comments for more details.
     // 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);
         format = (strcmp(format, "%.0f") == 0) ? "%d" : PatchFormatStringFloatToInt(format);
 
 
     // Tabbing or CTRL-clicking on Drag turns it into an input box
     // Tabbing or CTRL-clicking on Drag turns it into an input box