summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/OnScreenDisplay.cpp
diff options
context:
space:
mode:
authorLillyJadeKatrin <lilly.kitty.1988@gmail.com>2024-06-13 22:09:15 -0400
committerLillyJadeKatrin <lilly.kitty.1988@gmail.com>2024-06-15 22:42:35 -0400
commita79f4289722784452e0322cf46aa058bc4180d5f (patch)
tree5b38a6f0dad905986fcef46b96785b889d5c9e5c /Source/Core/VideoCommon/OnScreenDisplay.cpp
parent1b00b4e3d87e3cd3da90d35bf52741e50f66a3b0 (diff)
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.
Diffstat (limited to 'Source/Core/VideoCommon/OnScreenDisplay.cpp')
-rw-r--r--Source/Core/VideoCommon/OnScreenDisplay.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/OnScreenDisplay.cpp b/Source/Core/VideoCommon/OnScreenDisplay.cpp
index 5d9d90b95b..cc7fa6e22b 100644
--- a/Source/Core/VideoCommon/OnScreenDisplay.cpp
+++ b/Source/Core/VideoCommon/OnScreenDisplay.cpp
@@ -116,7 +116,8 @@ static float DrawMessage(int index, Message& msg, const ImVec2& position, int ti
}
// Use %s in case message contains %.
- ImGui::TextColored(ARGBToImVec4(msg.color), "%s", msg.text.c_str());
+ if (msg.text.size() > 0)
+ ImGui::TextColored(ARGBToImVec4(msg.color), "%s", msg.text.c_str());
window_height =
ImGui::GetWindowSize().y + (WINDOW_PADDING * ImGui::GetIO().DisplayFramebufferScale.y);
}