diff options
Diffstat (limited to 'Source/Core/VideoCommon/OnScreenUI.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/OnScreenUI.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/OnScreenUI.cpp b/Source/Core/VideoCommon/OnScreenUI.cpp index 935cec8619..4689bb6321 100644 --- a/Source/Core/VideoCommon/OnScreenUI.cpp +++ b/Source/Core/VideoCommon/OnScreenUI.cpp @@ -263,11 +263,12 @@ void OnScreenUI::DrawDebugText() { // Position under the FPS display. ImGui::SetNextWindowPos( - ImVec2(ImGui::GetIO().DisplaySize.x - 10.f * m_backbuffer_scale, 80.f * m_backbuffer_scale), + ImVec2(ImGui::GetIO().DisplaySize.x - ImGui::GetFontSize() * m_backbuffer_scale, + 80.f * m_backbuffer_scale), ImGuiCond_FirstUseEver, ImVec2(1.0f, 0.0f)); - ImGui::SetNextWindowSizeConstraints( - ImVec2(150.0f * m_backbuffer_scale, 20.0f * m_backbuffer_scale), - ImGui::GetIO().DisplaySize); + ImGui::SetNextWindowSizeConstraints(ImVec2(5.0f * ImGui::GetFontSize() * m_backbuffer_scale, + 2.1f * ImGui::GetFontSize() * m_backbuffer_scale), + ImGui::GetIO().DisplaySize); if (ImGui::Begin("Movie", nullptr, ImGuiWindowFlags_NoFocusOnAppearing)) { auto& movie = Core::System::GetInstance().GetMovie(); @@ -395,6 +396,12 @@ void OnScreenUI::Finalize() DrawChallengesAndLeaderboards(); ImGui::Render(); + // Check for font changes + ImGuiStyle& style = ImGui::GetStyle(); + const int size = Config::Get(Config::MAIN_OSD_FONT_SIZE); + if (size != style.FontSizeBase) + style.FontSizeBase = static_cast<float>(size); + // Create or update fonts. ImDrawData* draw_data = ImGui::GetDrawData(); if (draw_data->Textures != nullptr) |
