diff --git a/Sources/Ligature/UTF16CodePointTextViewTextTokenizer.swift b/Sources/Ligature/UTF16CodePointTextViewTextTokenizer.swift index 0775a8a..9ff4637 100644 --- a/Sources/Ligature/UTF16CodePointTextViewTextTokenizer.swift +++ b/Sources/Ligature/UTF16CodePointTextViewTextTokenizer.swift @@ -59,8 +59,8 @@ public struct UTF16CodePointTextViewTextTokenizer { } extension UTF16CodePointTextViewTextTokenizer { - public func location(for position: Position) -> CGFloat? { - textView.boundingRect(for: NSRange(position.. CGRect? { + textView.boundingRect(for: range) } /// A variant of position(from:toBoundary:inDirection:) that can take alignment into account. @@ -127,7 +127,7 @@ extension UTF16CodePointTextViewTextTokenizer { return self.position(from: position, toBoundary: granularity, inDirection: resolvedDir, alignment: alignment) case (.character, .layout(.down)): guard - let alignment = alignment ?? location(for: position), + let alignment = alignment ?? boundingRect(for: NSRange(position..