From d8c28dac9cbec17e70a8edf9471888dcdf27dc7d Mon Sep 17 00:00:00 2001 From: Pascal Thomet Date: Thu, 21 Nov 2024 10:39:41 +0100 Subject: [PATCH] if defined(HELLOIMGUI_MACOS) || defined(HELLOIMGUI_IOS): set fontSizeIncreaseFactor --- hello_imgui_cmake/hello_imgui_build_lib.cmake | 3 +++ src/hello_imgui/internal/backend_impls/abstract_runner.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hello_imgui_cmake/hello_imgui_build_lib.cmake b/hello_imgui_cmake/hello_imgui_build_lib.cmake index 0bc8278f..923da1b5 100644 --- a/hello_imgui_cmake/hello_imgui_build_lib.cmake +++ b/hello_imgui_cmake/hello_imgui_build_lib.cmake @@ -233,6 +233,9 @@ function(him_add_hello_imgui) if(APPLE AND NOT IOS) target_compile_definitions(${HELLOIMGUI_TARGET} PUBLIC HELLOIMGUI_MACOS) endif() + if(APPLE AND IOS) + target_compile_definitions(${HELLOIMGUI_TARGET} PUBLIC HELLOIMGUI_IOS) + endif() if(APPLE) target_compile_options(${HELLOIMGUI_TARGET} PRIVATE "-x" "objective-c++") endif() diff --git a/src/hello_imgui/internal/backend_impls/abstract_runner.cpp b/src/hello_imgui/internal/backend_impls/abstract_runner.cpp index b08085dc..05ca8538 100644 --- a/src/hello_imgui/internal/backend_impls/abstract_runner.cpp +++ b/src/hello_imgui/internal/backend_impls/abstract_runner.cpp @@ -362,7 +362,7 @@ float _DefaultOsFontRenderingScale() fontSizeIncreaseFactor = windowDevicePixelRatio; #endif - #ifdef HELLOIMGUI_MACOS + #if defined(HELLOIMGUI_MACOS) || defined(HELLOIMGUI_IOS) // Crisp fonts on macOS: // cf https://github.com/ocornut/imgui/issues/5301 // Issue with macOS is that it pretends screen has 2x fewer pixels than it actually does.