mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Fix page guide locattion on El Capitan
This commit is contained in:
parent
199c3bb8e7
commit
1d8b279830
@ -8,6 +8,7 @@ develop
|
||||
### Fixes
|
||||
|
||||
- Fix an issue where calculation of hanging indent width was sometime incorrect.
|
||||
- Fix an issue on El Capitan where page guide was drawn at the wrong column.
|
||||
|
||||
|
||||
|
||||
|
@ -632,11 +632,11 @@ static NSPoint kTextContainerOrigin;
|
||||
|
||||
NSFont *font = [(CELayoutManager *)[self layoutManager] textFont];
|
||||
font = [font screenFont] ? : font;
|
||||
column *= [@"M" sizeWithAttributes:@{NSFontAttributeName: font}].width;
|
||||
CGFloat charWidth = [font advancementForGlyph:(NSGlyph)' '].width;
|
||||
|
||||
CGFloat inset = [self textContainerOrigin].x;
|
||||
CGFloat linePadding = [[self textContainer] lineFragmentPadding];
|
||||
CGFloat x = floor(column + inset + linePadding) + 2.5; // +2px for adjustment
|
||||
CGFloat x = floor(charWidth * column + inset + linePadding) + 2.5; // +2px for adjustment
|
||||
|
||||
[[[self textColor] colorWithAlphaComponent:0.2] set];
|
||||
[NSBezierPath strokeLineFromPoint:NSMakePoint(x, NSMinY(dirtyRect))
|
||||
|
Loading…
Reference in New Issue
Block a user