Fix margins on icon-only messages

Messages with an icon and no text (such as in the game start sequence) had an oversized margin due to ImGui adding padding for an empty string.
This commit is contained in:
LillyJadeKatrin 2024-06-13 22:09:15 -04:00
parent 1b00b4e3d8
commit a79f428972
1 changed files with 2 additions and 1 deletions

View File

@ -116,6 +116,7 @@ static float DrawMessage(int index, Message& msg, const ImVec2& position, int ti
} }
// Use %s in case message contains %. // Use %s in case message contains %.
if (msg.text.size() > 0)
ImGui::TextColored(ARGBToImVec4(msg.color), "%s", msg.text.c_str()); ImGui::TextColored(ARGBToImVec4(msg.color), "%s", msg.text.c_str());
window_height = window_height =
ImGui::GetWindowSize().y + (WINDOW_PADDING * ImGui::GetIO().DisplayFramebufferScale.y); ImGui::GetWindowSize().y + (WINDOW_PADDING * ImGui::GetIO().DisplayFramebufferScale.y);