From 401f2652ca5e035691eb6a6c3f5b46cfe9e4f08c Mon Sep 17 00:00:00 2001 From: Davide Pesavento Date: Sat, 17 May 2025 00:05:41 -0400 Subject: [PATCH] Achievements: Use round instead of ceil for unlocked percentage (#3418) --- src/core/achievements.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/achievements.cpp b/src/core/achievements.cpp index 02be58551..b90c9e297 100644 --- a/src/core/achievements.cpp +++ b/src/core/achievements.cpp @@ -2654,7 +2654,7 @@ void Achievements::DrawPauseMenuOverlays(float start_pos_y) TRANSLATE_DISAMBIG("Achievements", "Achievements Unlocked", "Pause Menu")); const float unlocked_fraction = static_cast(s_state.game_summary.num_unlocked_achievements) / static_cast(s_state.game_summary.num_core_achievements); - buffer.format("{}%", static_cast(std::ceil(unlocked_fraction * 100.0f))); + buffer.format("{}%", static_cast(std::round(unlocked_fraction * 100.0f))); text_size = UIStyle.MediumFont->CalcTextSizeA(UIStyle.MediumFont->FontSize, FLT_MAX, 0.0f, IMSTR_START_END(buffer)); dl->AddText(UIStyle.MediumFont, UIStyle.MediumFont->FontSize, ImVec2(text_pos.x + (box_content_width - text_size.x), text_pos.y), text_color, @@ -2887,7 +2887,7 @@ void Achievements::DrawAchievementsWindow() ImGui::GetColorU32(UIStyle.SecondaryColor), progress_rounding); } - text.format("{}%", static_cast(std::round(fraction * 100.0f))); + text.format("{}%", static_cast(std::round(fraction * 100.0f))); text_size = UIStyle.MediumFont->CalcTextSizeA(UIStyle.MediumFont->FontSize, FLT_MAX, 0.0f, IMSTR_START_END(text)); const ImVec2 text_pos(