diff --git a/engine/source/runtime/function/render/source/surface_ui.cpp b/engine/source/runtime/function/render/source/surface_ui.cpp index 1421c4214..494bc06fc 100644 --- a/engine/source/runtime/function/render/source/surface_ui.cpp +++ b/engine/source/runtime/function/render/source/surface_ui.cpp @@ -13,8 +13,10 @@ using namespace Pilot; void window_content_scale_callback(GLFWwindow* window, float x_scale, float y_scale) { - float font_scale = fmax(1.0f, fmax(x_scale, y_scale)); +#if defined(__MACH__) + float font_scale = fmax(1.0f, fmax(x_scale, y_scale)); ImGui::GetIO().FontGlobalScale = 1.0f / font_scale; +#endif } int SurfaceUI::initialize(SurfaceRHI* rhi, PilotRenderer* prenderer, std::shared_ptr pio) @@ -59,8 +61,8 @@ int SurfaceUI::initialize(SurfaceRHI* rhi, PilotRenderer* prenderer, std::shared init_info.MinImageCount = rhi->m_vulkan_manager->m_max_frames_in_flight; init_info.ImageCount = rhi->m_vulkan_manager->m_max_frames_in_flight; ImGui_ImplVulkan_Init(&init_info, rhi->m_vulkan_manager->getLightingPass()); - - ImGui::GetIO().FontGlobalScale = 1.0f / font_scale; + + window_content_scale_callback(pio->m_window, x_scale, y_scale); glfwSetWindowContentScaleCallback(pio->m_window, window_content_scale_callback); // fonts upload