diff --git a/apple/common/apple_gfx_context.c.inl b/apple/common/apple_gfx_context.c.inl index ce1a300a56..3a81a6df92 100644 --- a/apple/common/apple_gfx_context.c.inl +++ b/apple/common/apple_gfx_context.c.inl @@ -226,7 +226,7 @@ static bool apple_gfx_ctx_set_video_mode(void *data, unsigned width, unsigned he return true; } -static CGFloat apple_gfx_ctx_get_native_scale(void) +CGFloat apple_gfx_ctx_get_native_scale(void) { SEL selector = NSSelectorFromString(BOXSTRING("scale")); RAScreen *screen = (RAScreen*)get_chosen_screen(); diff --git a/apple/iOS/platform.m b/apple/iOS/platform.m index 9dec2bf54b..85e822883c 100644 --- a/apple/iOS/platform.m +++ b/apple/iOS/platform.m @@ -83,13 +83,14 @@ const void* apple_get_frontend_settings(void) return settings; } +extern CGFloat apple_gfx_ctx_get_native_scale(void); -// Input helpers: This is kept here because it needs objective-c +/* Input helpers: This is kept here because it needs ObjC */ static void handle_touch_event(NSArray* touches) { NSUInteger i; apple_input_data_t *apple = (apple_input_data_t*)driver.input_data; - const float scale = [[UIScreen mainScreen] scale]; + const float scale = apple_gfx_ctx_get_native_scale(); if (!apple) return;