Permalink
Browse files

Merge pull request #37 from github/fix-nsview-flippedness

Handle -[NSView isFlipped] when rendering the rootView of a TUIViewNSViewContainer
  • Loading branch information...
joshaber committed Jul 31, 2012
2 parents e8ebb20 + 0588716 commit 574340d57db39a2e7f9939d03ef03108f215a953
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/UIKit/TUIViewNSViewContainer.m
@@ -163,7 +163,15 @@ - (void)drawRect:(CGRect)rect {
}
CGContextRef context = [NSGraphicsContext currentContext].graphicsPort;
+ CGContextSaveGState(context);
+
+ if ([self.rootView isFlipped]) {
+ CGContextTranslateCTM(context, 0, self.bounds.size.height);
+ CGContextScaleCTM(context, 1, -1);
+ }
+
[self.rootView.layer renderInContext:context];
+ CGContextRestoreGState(context);
}
- (void)startRenderingContainedView; {

0 comments on commit 574340d

Please sign in to comment.