Skip to content

Instantly share code, notes, and snippets.

@adrienbrault
Created August 27, 2011 10:52
Show Gist options
  • Save adrienbrault/1175242 to your computer and use it in GitHub Desktop.
Save adrienbrault/1175242 to your computer and use it in GitHub Desktop.
- (void)drawRect:(NSRect)dirtyRect
{
NSGraphicsContext *graphicContext = [NSGraphicsContext currentContext];
CGContextRef context = [graphicContext graphicsPort];
// Set the origin of the coordinate system in the upper left corner instead of the lower left corner.
CGContextConcatCTM(context,
CGAffineTransformMake(1.0, 0.0, 0.0, -1.0, 0.0, self.frame.size.height));
}
- (BOOL)isFlipped
{
return YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment