src/ios/native_window.mm in reflexion-0.1.9.1 vs src/ios/native_window.mm in reflexion-0.1.10

- old
+ new

@@ -24,11 +24,20 @@ }// Reflex static CGRect device_frame () { - return [[UIScreen mainScreen] applicationFrame]; + UIScreen* screen = [UIScreen mainScreen]; + CGRect rect = screen.applicationFrame; + CGFloat scale = screen.scale; + + rect.origin.x = 0; + rect.origin.y = 0; + rect.size.width *= scale; + rect.size.height *= scale; + + return rect; } @implementation NativeWindow @@ -36,11 +45,11 @@ { self = [super initWithFrame: device_frame()]; if (!self) return nil; pref = new Reflex::Window::Ref; - view_controller = [[OpenGLViewController alloc] initWithNibName: nil bundle: nil]; + view_controller = [[OpenGLViewController alloc] init]; self.rootViewController = view_controller; return self; } @@ -225,13 +234,8 @@ if (!REF) return; Reflex::NativePointerEvent e(touches, event, view_controller.view, Reflex::PointerEvent::MOVE); REF->on_pointer(&e); - } - - + (CGRect) frameRectForContentRect: (CGRect) contentRect - { - return device_frame(); } @end// NativeWindow