summaryrefslogtreecommitdiff
path: root/UICaboodle
diff options
context:
space:
mode:
authorRyan Petrich <rpetrich@gmail.com>2010-09-22 20:17:41 -0600
committerJay Freeman (saurik) <saurik@saurik.com>2010-09-30 10:42:37 +0000
commit69b82e6a6c427a0a4e2efe8701cd13570ee90624 (patch)
treedf371a8c27cca3815b0d2e5d38e7bc2fb24ca945 /UICaboodle
parent9cb0bff2ae8ed90d6d2a6ca0283fbc7013aeb5ab (diff)
Fix viewport issues with landscape and web document view's frame.y property becoming negative
Diffstat (limited to 'UICaboodle')
-rw-r--r--UICaboodle/BrowserView.mm32
1 files changed, 31 insertions, 1 deletions
diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm
index 9bfeb79..4523f91 100644
--- a/UICaboodle/BrowserView.mm
+++ b/UICaboodle/BrowserView.mm
@@ -148,6 +148,30 @@ static Class $UIWebBrowserView;
@end
+@interface BrowserViewActualView : UIView {
+@private
+ UIWebDocumentView *documentView;
+}
+@property (nonatomic, retain) UIWebDocumentView *documentView;
+@end
+
+@implementation BrowserViewActualView
+
+@synthesize documentView;
+
+- (void)dealloc {
+ [documentView release];
+ [super dealloc];
+}
+
+- (void)layoutSubviews {
+ [super layoutSubviews];
+ if ([documentView respondsToSelector:@selector(setMinimumSize:)])
+ [documentView setMinimumSize:documentView.bounds.size];
+}
+
+@end
+
#define ShowInternals 0
#define LogBrowser 1
@@ -1258,6 +1282,9 @@ static Class $UIWebBrowserView;
loading_ = [[NSMutableSet alloc] initWithCapacity:3];
popup_ = false;
+ BrowserViewActualView *actualView = [[BrowserViewActualView alloc] initWithFrame:CGRectZero];
+ [self setView:actualView];
+
struct CGRect bounds = [[self view] bounds];
scroller_ = [[objc_getClass(Wildcat_ ? "UIScrollView" : "UIScroller") alloc] initWithFrame:bounds];
@@ -1377,6 +1404,9 @@ static Class $UIWebBrowserView;
else
[preferences _setLayoutInterval:0];
}
+
+ actualView.documentView = document_;
+ [actualView release];
[self setViewportWidth:width];
@@ -1411,7 +1441,7 @@ static Class $UIWebBrowserView;
[scroller_ setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
[indicator_ setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin];
- [document_ setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
+ [document_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
/*UIWebView *test([[[UIWebView alloc] initWithFrame:[[self view] bounds]] autorelease]);
[test loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.saurik.com/"]]];