BugFix: Mouse click on line calculation

This commit is contained in:
tudnai 2022-11-25 20:24:27 -08:00
parent 0ac222ad3f
commit 143124f74a
1 changed files with 2 additions and 1 deletions

View File

@ -322,7 +322,8 @@ N V - B D I Z C
func getLine(inView view: NSTextView, forY: CGFloat) -> Int {
// var scrollTo = view.visibleRect.origin
let lineSpacing = CGFloat(1.5)
let lineHeight = view.font!.pointSize * lineSpacing
let fontPointSize = CGFloat(10) // view.font!.pointSize
let lineHeight = fontPointSize * lineSpacing
let line = round(forY) / lineHeight