Skip to content

Commit

Permalink
Scale challenge icons based on screen height
Browse files Browse the repository at this point in the history
  • Loading branch information
LillyJadeKatrin committed Jun 15, 2024
1 parent 56fd9c1 commit 11ad587
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/Core/VideoCommon/OnScreenUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ void OnScreenUI::DrawChallengesAndLeaderboards()
float leaderboard_y = ImGui::GetIO().DisplaySize.y;
if (!m_challenge_texture_map.empty())
{
float scale = ImGui::GetIO().DisplaySize.y / 1024.0;
ImGui::SetNextWindowPos(ImVec2(ImGui::GetIO().DisplaySize.x, ImGui::GetIO().DisplaySize.y), 0,
ImVec2(1.0, 1.0));
ImGui::SetNextWindowSize(ImVec2(0.0f, 0.0f));
Expand All @@ -368,8 +369,8 @@ void OnScreenUI::DrawChallengesAndLeaderboards()
{
for (auto& [name, texture] : m_challenge_texture_map)
{
ImGui::Image(texture.get(), ImVec2(static_cast<float>(texture->GetWidth()),
static_cast<float>(texture->GetHeight())));
ImGui::Image(texture.get(), ImVec2(static_cast<float>(texture->GetWidth() * scale),
static_cast<float>(texture->GetHeight() * scale)));
}
leaderboard_y -= ImGui::GetWindowHeight();
}
Expand Down

0 comments on commit 11ad587

Please sign in to comment.