@@ -105,10 +105,20 @@ namespace AZ
|
||||
// Let our ImguiAtomSystemComponent know once we successfully connect and update the viewport size.
|
||||
if (!m_initialized)
|
||||
{
|
||||
auto atomViewportRequests = AZ::Interface<AZ::RPI::ViewportContextRequestsInterface>::Get();
|
||||
auto defaultViewportContext = atomViewportRequests->GetDefaultViewportContext();
|
||||
OnViewportDpiScalingChanged(defaultViewportContext->GetDpiScalingFactor());
|
||||
m_initialized = true;
|
||||
}
|
||||
});
|
||||
#endif
|
||||
#endif //define(IMGUI_ENABLED)
|
||||
}
|
||||
|
||||
void ImguiAtomSystemComponent::OnViewportDpiScalingChanged(float dpiScale)
|
||||
{
|
||||
#if defined(IMGUI_ENABLED)
|
||||
ImGui::ImGuiManagerBus::Broadcast(&ImGui::ImGuiManagerBus::Events::SetDpiScalingFactor, dpiScale);
|
||||
#endif //define(IMGUI_ENABLED)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user