mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 23:55:40 +00:00
CommonHostInterface: Fix crash in FS UI when scale changes
This commit is contained in:
parent
a542fa85d6
commit
b9d238d28b
|
@ -617,20 +617,26 @@ void CommonHostInterface::OnHostDisplayResized()
|
|||
ImGui::GetStyle().WindowMinSize = ImVec2(1.0f, 1.0f);
|
||||
ImGui::StyleColorsDarker();
|
||||
ImGui::GetStyle().ScaleAllSizes(new_scale);
|
||||
ImGuiFullscreen::ResetFonts();
|
||||
if (!m_display->UpdateImGuiFontTexture())
|
||||
Panic("Failed to recreate font texture after resize");
|
||||
}
|
||||
|
||||
if (m_fullscreen_ui_enabled)
|
||||
{
|
||||
if (ImGuiFullscreen::UpdateLayoutScale())
|
||||
ImGuiFullscreen::UpdateLayoutScale();
|
||||
ImGuiFullscreen::UpdateFonts();
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGuiFullscreen::ResetFonts();
|
||||
}
|
||||
|
||||
if (!m_display->UpdateImGuiFontTexture())
|
||||
Panic("Failed to recreate font texture after scale+resize");
|
||||
}
|
||||
else if (m_fullscreen_ui_enabled && ImGuiFullscreen::UpdateLayoutScale())
|
||||
{
|
||||
if (ImGuiFullscreen::UpdateFonts())
|
||||
{
|
||||
if (!m_display->UpdateImGuiFontTexture())
|
||||
Panic("Failed to update font texture");
|
||||
}
|
||||
Panic("Failed to update font texture after resize");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue