Skip to content

Commit

Permalink
if defined(HELLOIMGUI_MACOS) || defined(HELLOIMGUI_IOS): set fontSize…
Browse files Browse the repository at this point in the history
…IncreaseFactor
  • Loading branch information
pthom committed Nov 21, 2024
1 parent 2ecddcf commit fd0f5eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hello_imgui_cmake/hello_imgui_build_lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions src/hello_imgui/internal/backend_impls/abstract_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ float _DefaultOsFontRenderingScale()
// while screen renders at 2x scale.
fontSizeIncreaseFactor = (float) NSScreen.mainScreen.backingScaleFactor;
#endif
#ifdef HELLOIMGUI_IOS
fontSizeIncreaseFactor = 2.0; // Retina
#endif

#ifdef HELLOIMGUI_WITH_REMOTE_DISPLAY
if (HelloImGui::GetRunnerParams()->remoteParams.enableRemoting)
Expand Down

0 comments on commit fd0f5eb

Please sign in to comment.