From 1448d55391bcc4bf4d1d8a818072520aa2a80b0b Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Tue, 24 Feb 2015 05:40:45 +0100 Subject: [PATCH] (iOS) Use apple_gfx_ctx_get_native_scale for handle_touch_event too - should hopefully fix touch overlay issues on iPhone 6+ --- apple/common/apple_gfx_context.c.inl | 2 +- apple/iOS/platform.m | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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;