mirror of
https://github.com/shadps4-emu/ext-imgui.git
synced 2024-11-27 04:00:51 +00:00
Debug Log, Test Engine: avoid duplicate carriage return when using ImGuiDebugLogFlags_OutputToTestEngine. (#5855)
This commit is contained in:
parent
868f444620
commit
661c388515
@ -15568,8 +15568,11 @@ void ImGui::DebugLogV(const char* fmt, va_list args)
|
||||
if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToTTY)
|
||||
IMGUI_DEBUG_PRINTF("%s", g.DebugLogBuf.begin() + old_size);
|
||||
#ifdef IMGUI_ENABLE_TEST_ENGINE
|
||||
// IMGUI_TEST_ENGINE_LOG() adds a trailing \n automatically
|
||||
const int new_size = g.DebugLogBuf.size();
|
||||
const bool trailing_carriage_return = (g.DebugLogBuf[new_size - 1] == '\n');
|
||||
if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToTestEngine)
|
||||
IMGUI_TEST_ENGINE_LOG("%s", g.DebugLogBuf.begin() + old_size);
|
||||
IMGUI_TEST_ENGINE_LOG("%.*s", new_size - old_size - (trailing_carriage_return ? 1 : 0), g.DebugLogBuf.begin() + old_size);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user