Permalink
Browse files

Merge remote-tracking branch 'origin/nstextview-10.6-compatibility'

  • Loading branch information...
2 parents f71c6f6 + 3b648af commit cc2e149811143143049d129862f448e1f4f60792 @jspahrsummers jspahrsummers committed Jul 25, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/Support/NSTextView+TUIExtensions.m
@@ -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);

0 comments on commit cc2e149

Please sign in to comment.