Skip to content

Commit

Permalink
ImGuiUtils: fixed LogWindow::AddLog function
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Jun 18, 2023
1 parent 5f2e712 commit 9771185
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Imgui/src/ImGuiUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,12 @@ class LogWindowImpl
Clear();
}

void AddLog(const char* fmt, ...)
void AddLog(const char* fmt, va_list args)
{
std::lock_guard<std::mutex> Guard{m_Mtx};

int old_size = Buf.size();
va_list args;
va_start(args, fmt);
int old_size = Buf.size();
Buf.appendfv(fmt, args);
va_end(args);
for (int new_size = Buf.size(); old_size < new_size; old_size++)
if (Buf[old_size] == '\n')
LineOffsets.push_back(old_size + 1);
Expand Down

0 comments on commit 9771185

Please sign in to comment.