Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into remove-tuiimage

  • Loading branch information...
commit 79aab6a7248b1dc145030023b6509fcc2ea4527d 2 parents 9ae7ea4 + 01e83bd
Justin Spahr-Summers jspahrsummers authored
8 lib/Support/NSTextView+TUIExtensions.m
View
@@ -26,9 +26,13 @@ static void fixedDrawRect (NSTextView *self, SEL _cmd, NSRect rect) {
CGContextSetShouldSubpixelPositionFonts(context, NO);
CGContextSetShouldSubpixelQuantizeFonts(context, NO);
- if (self.superview) {
- // NSTextView likes to fall on non-integral points sometimes -- fix that
+ // NSTextView likes to fall on non-integral points sometimes -- fix that
+ if ([self.superview respondsToSelector:@selector(backingAlignedRect:options:)]) {
self.frame = [self.superview backingAlignedRect:self.frame options:NSAlignAllEdgesNearest];
+ } else {
+ // This is less reliable, since one of our ancestors may not be on
+ // integral points.
+ self.frame = NSIntegralRect(self.frame);
}
originalDrawRectIMP(self, _cmd, rect);
1  lib/UIKit/TUINSView.m
View
@@ -152,6 +152,7 @@ - (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
+ _rootView.hostView = nil;
_rootView.nsView = nil;
[_rootView removeFromSuperview];
7 lib/UIKit/TUIView.m
View
@@ -362,14 +362,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);
Please sign in to comment.
Something went wrong with that request. Please try again.