From 8f7673b8eda4895ac69d5693cf1a122d3d4813bd Mon Sep 17 00:00:00 2001 From: Matt <85322+mattmassicotte@users.noreply.github.com> Date: Thu, 19 Dec 2024 07:58:47 -0500 Subject: [PATCH] public boundingRect for NSTextLayoutManager --- README.md | 1 + Sources/Glyph/NSTextLayoutManager+Additions.swift | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 68e6582..8ed114d 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ func boundingRect(for range: NSRange) -> CGRect? func enumerateLineFragments(for rect: CGRect, strictIntersection: Bool = true, options: NSTextLayoutFragment.EnumerationOptions = [], block: (CGRect, NSRange, inout Bool) -> Void) func enumerateLineFragments(in range: NSRange, options: NSTextLayoutFragment.EnumerationOptions = [], block: (CGRect, NSRange, inout Bool) -> Void) func enumerateLineFragments(from index: Int, options: NSTextLayoutFragment.EnumerationOptions = [], block: (CGRect, NSRange, inout Bool) -> Void) +func boundingRect(for range: NSRange) -> CGRect? ``` ### `NSTextLayoutFragment` Additions diff --git a/Sources/Glyph/NSTextLayoutManager+Additions.swift b/Sources/Glyph/NSTextLayoutManager+Additions.swift index f540f92..69393a3 100644 --- a/Sources/Glyph/NSTextLayoutManager+Additions.swift +++ b/Sources/Glyph/NSTextLayoutManager+Additions.swift @@ -176,7 +176,7 @@ extension NSTextLayoutManager { } } - func boundingRect(for range: NSRange) -> CGRect? { + public func boundingRect(for range: NSRange) -> CGRect? { var rect: CGRect? = nil enumerateTextLineFragments(in: range, options: [.ensuresLayout]) { fragment, lineFragment, lineRect, lineRange, stop in