Adjust line number view ticks for vertical orientation

This commit is contained in:
1024jp 2022-08-11 20:31:09 +09:00
parent fb23961991
commit acca92477f
2 changed files with 4 additions and 3 deletions

View File

@ -28,6 +28,7 @@ Change Log
- Improve the algorithm of uncommenting.
- Improve the algorithm of encoding detection.
- Deprecate the “Ignore line endings when counting characters” option.
- [trivial] Adjust ticks in the line number view for vertical orientation.
- [trivial] Save documents asynchronously.
- [trivial] Organize the editor's contextual menu.
- [trivial] Improve the basic regular expression syntax reference.

View File

@ -55,7 +55,7 @@ final class LineNumberView: NSView {
// calculate margins
self.padding = self.charWidth
self.tickLength = (fontSize / 3).rounded(.up)
self.tickLength = (scale * fontSize / 3).rounded(.up)
}
}
@ -254,7 +254,7 @@ final class LineNumberView: NSView {
let textView = self.textView,
let layoutManager = textView.layoutManager as? LayoutManager,
let context = NSGraphicsContext.current?.cgContext
else { return assertionFailure() }
else { return assertionFailure() }
context.saveGState()
@ -315,7 +315,7 @@ final class LineNumberView: NSView {
// draw tick
if isVerticalText {
let rect = CGRect(x: y.rounded() + 0.5, y: 1, width: 0, height: drawingInfo.tickLength)
context.stroke(rect, width: 1)
context.stroke(rect, width: scale)
}
case .wrapped: