UI: Fix vertical alignment of achievement progress text

This commit is contained in:
Rares-Alexandru Fodor 2025-04-13 19:34:27 +03:00 committed by lightningterror
parent 123cd3a092
commit 42cd80c172
1 changed files with 2 additions and 0 deletions

View File

@ -2266,7 +2266,9 @@ void Achievements::DrawAchievementsWindow()
ImGui::GetColorU32(ImGuiFullscreen::UISecondaryColor));
text.format("{}%", static_cast<int>(std::round(fraction * 100.0f)));
ImGui::PushFont(g_medium_font);
text_size = ImGui::CalcTextSize(text.c_str(), text.end_ptr());
ImGui::PopFont();
const ImVec2 text_pos(progress_bb.Min.x + ((progress_bb.Max.x - progress_bb.Min.x) / 2.0f) - (text_size.x / 2.0f),
progress_bb.Min.y + ((progress_bb.Max.y - progress_bb.Min.y) / 2.0f) - (text_size.y / 2.0f));
dl->AddText(g_medium_font, g_medium_font->FontSize, text_pos, ImGui::GetColorU32(ImGuiFullscreen::UIPrimaryTextColor),