Add DPI scaling to IMGUI

Signed-off-by: nvsickle <nvsickle@amazon.com>
This commit is contained in:
nvsickle
2021-06-21 22:15:39 -07:00
parent 0c97888d0f
commit dd20a598b2
10 changed files with 58 additions and 2 deletions
+14
View File
@@ -277,6 +277,20 @@ void ImGui::ImGuiManager::RestoreRenderWindowSizeToDefault()
InitWindowSize();
}
void ImGui::ImGuiManager::SetDpiScalingFactor(float dpiScalingFactor)
{
ImGuiIO& io = ImGui::GetIO();
// Set the global font scale to size our UI to the scaling factor
// Note: Currently we use the default, 13px fixed-size IMGUI font, so this can get somewhat blurry
io.FontGlobalScale = dpiScalingFactor;
}
float ImGui::ImGuiManager::GetDpiScalingFactor() const
{
ImGuiIO& io = ImGui::GetIO();
return io.FontGlobalScale;
}
void ImGuiManager::Render()
{
if (m_clientMenuBarState == DisplayState::Hidden && m_editorWindowState == DisplayState::Hidden)