Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Clear context after changing context scale #126

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/UIKit/TUIView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see.

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

CGContextSetAllowsAntialiasing(context, true); \
CGContextSetShouldAntialias(context, true); \
CGContextSetShouldSmoothFonts(context, !_viewFlags.disableSubpixelTextRendering);
Expand Down