Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Clear context after changing context scale #126

Open
wants to merge 2 commits into from

2 participants

@brutella

Otherwise we get strange artifacts when re-drawing TUILabels on Retina displays.

lib/UIKit/TUIView.m
((6 lines not shown))
CGFloat scale = [self.layer respondsToSelector:@selector(contentsScale)] ? self.layer.contentsScale : 1.0f; \
CGContextScaleCTM(context, scale, scale); \
+ if(_viewFlags.clearsContextBeforeDrawing) \
+ CGContextClearRect(context, b); \
@dannygreg Collaborator

This seems to change nothing except the indenting. Is that correct?

Nope, the commit moves the two lines after the CGContextScaleCTM call. The indentation looks good to my in Xcode. Seems to be an issue of using tabs instead of 4 spaces.

@dannygreg Collaborator

Ah I see.

This project uses tabs rather than 4 spaces, please correct that and push to this branch. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 10, 2012
  1. @brutella
Commits on Aug 11, 2012
  1. @brutella

    Update lib/UIKit/TUIView.m

    brutella authored
    Fixed line indentation
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/UIKit/TUIView.m
View
4 lib/UIKit/TUIView.m
@@ -308,10 +308,10 @@ - (void)displayLayer:(CALayer *)layer
CGRect b = self.bounds; \
CGContextRef context = [self _CGContext]; \
TUIGraphicsPushContext(context); \
- if(_viewFlags.clearsContextBeforeDrawing) \
- CGContextClearRect(context, b); \
CGFloat scale = [self.layer respondsToSelector:@selector(contentsScale)] ? self.layer.contentsScale : 1.0f; \
CGContextScaleCTM(context, scale, scale); \
+ if(_viewFlags.clearsContextBeforeDrawing) \
+ CGContextClearRect(context, b); \
CGContextSetAllowsAntialiasing(context, true); \
CGContextSetShouldAntialias(context, true); \
CGContextSetShouldSmoothFonts(context, !_viewFlags.disableSubpixelTextRendering);
Something went wrong with that request. Please try again.