Permalink
Browse files

Merge pull request #27 from github/retina-partial-redraw-fix

Fix partial redrawing of views on retina displays
  • Loading branch information...
2 parents cc2e149 + 5207f17 commit b2a68369ca1d4aa2d12af9be546bc7fcf8c974d4 @joshaber joshaber committed Jul 25, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/UIKit/TUIView.m
View
@@ -363,14 +363,15 @@ - (void)displayLayer:(CALayer *)layer
void (^drawBlock)(void) = ^{
CGContextRef context = [self _CGContext];
TUIGraphicsPushContext(context);
- if (_viewFlags.clearsContextBeforeDrawing) {
- CGContextClearRect(context, rectToDraw);
- }
CGFloat scale = [self.layer respondsToSelector:@selector(contentsScale)] ? self.layer.contentsScale : 1.0f;
TUISetCurrentContextScaleFactor(scale);
CGContextScaleCTM(context, scale, scale);
+ if (_viewFlags.clearsContextBeforeDrawing) {
+ CGContextClearRect(context, rectToDraw);
+ }
+
CGContextSetAllowsAntialiasing(context, true);
CGContextSetShouldAntialias(context, true);
CGContextSetShouldSmoothFonts(context, !_viewFlags.disableSubpixelTextRendering);

0 comments on commit b2a6836

Please sign in to comment.