We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 38d0678 commit a0e5dfeCopy full SHA for a0e5dfe
Proton/Sources/Swift/Core/RichTextView.swift
@@ -837,7 +837,9 @@ class RichTextView: AutogrowingTextView {
837
let lineRect = layoutManager.boundingRect(forGlyphRange: NSRange(location: location, length: 0), in: textContainer)
838
839
var caretRect = super.caretRect(for: position)
840
- caretRect.origin.y = lineRect.minY + textContainerInset.top
+ // For non-Latin chars, the line height is calculated differently. Hence, using the higher of
841
+ // existing Caret rect or lineHeight.y position for caret positioning.
842
+ caretRect.origin.y = max(caretRect.origin.y, lineRect.minY + textContainerInset.top)
843
caretRect.size.height = lineRect.height
844
return caretRect
845
}
0 commit comments