Fix line number drawing on Mountain Lion (fix #383)

This commit is contained in:
1024jp 2015-05-13 20:40:59 +09:00
parent 0eebc3a2eb
commit 7203f66248
2 changed files with 10 additions and 1 deletions

View File

@ -26,6 +26,11 @@ develop
- Improve general stability.
### Fixes
- Fix an issue where line numbers did't draw completely on OS X 10.8 when scroll bar is always shown.
2.1.6
--------------------------

View File

@ -183,8 +183,12 @@ static const NSString *LineNumberFontName;
CGContextSetTextMatrix(context, transform);
CFRelease(font);
// add enough buffer to avoid broken drawing on Mountain Lion (10.8) with scroller (2015-07)
NSRect visibleRect = [[self textView] visibleRect];
visibleRect.size.height += fontSize;
// get glyph range which line number should be drawn
NSRange visibleGlyphRange = [layoutManager glyphRangeForBoundingRect:[[self textView] visibleRect]
NSRange visibleGlyphRange = [layoutManager glyphRangeForBoundingRect:visibleRect
inTextContainer:[[self textView] textContainer]];
// counters