Kaydet (Commit) f0fb30e7 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Get rid of some crack

Change-Id: I9806eb87e8d679c3b37de9cf7b87e26c3d4b5387
üst c7550951
...@@ -51,9 +51,6 @@ static BOOL keyboardShows; ...@@ -51,9 +51,6 @@ static BOOL keyboardShows;
vc.view = self.view; vc.view = self.view;
theView = self.view; theView = self.view;
// This is baaad
theView->applicationFrame = applicationFrame;
self.view->textView = [[UITextView alloc] initWithFrame: r]; self.view->textView = [[UITextView alloc] initWithFrame: r];
self.view->textView.autocapitalizationType = UITextAutocapitalizationTypeNone; self.view->textView.autocapitalizationType = UITextAutocapitalizationTypeNone;
self.view->textView.alpha = 0; self.view->textView.alpha = 0;
...@@ -71,9 +68,9 @@ static BOOL keyboardShows; ...@@ -71,9 +68,9 @@ static BOOL keyboardShows;
NSLog(@"statusBarOrientation: %ld", (long) [[UIApplication sharedApplication] statusBarOrientation]); NSLog(@"statusBarOrientation: %ld", (long) [[UIApplication sharedApplication] statusBarOrientation]);
if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]))
touch_lo_set_view_size(applicationFrame.size.height, applicationFrame.size.width); touch_lo_set_view_size(r.size.height, r.size.width);
else else
touch_lo_set_view_size(applicationFrame.size.width, applicationFrame.size.height); touch_lo_set_view_size(r.size.width, r.size.height);
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil];
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
{ {
@public @public
UITextView* textView; UITextView* textView;
CGRect applicationFrame;
} }
- (void)drawRect:(CGRect)rect; - (void)drawRect:(CGRect)rect;
- (void)tapGesture:(UITapGestureRecognizer *)gestureRecognizer; - (void)tapGesture:(UITapGestureRecognizer *)gestureRecognizer;
......
...@@ -128,13 +128,7 @@ ...@@ -128,13 +128,7 @@
switch ([[UIApplication sharedApplication] statusBarOrientation]) { switch ([[UIApplication sharedApplication] statusBarOrientation]) {
case UIInterfaceOrientationPortrait: case UIInterfaceOrientationPortrait:
// No idea why I need to do this ugly subtraction of CGContextTranslateCTM(context, 0, self.frame.size.height);
// applicationFrame.origin.y here. The handling of View frame
// and applicationFrame has been a bit of a mystery to me.
// Anyway, unless a Right Way to do this is figured out,
// corresponding hacks are needed for the other orientations,
// too, obiously.
CGContextTranslateCTM(context, 0, self.frame.size.height - applicationFrame.origin.y);
CGContextScaleCTM(context, 1, -1); CGContextScaleCTM(context, 1, -1);
break; break;
case UIInterfaceOrientationLandscapeLeft: case UIInterfaceOrientationLandscapeLeft:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment