Skip to content

Commit

Permalink
Invoke block directly
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Dec 20, 2024
1 parent 4539e6b commit a3dcc55
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Sources/Glyph/NSTextContainer+Additions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ extension NSTextContainer {
/// - Parameter strictIntersection: If true, the result will only be rect and range strictly within the `rect` parameter. This is more expensive to compute.
public func enumerateLineFragments(for rect: CGRect, strictIntersection: Bool, block: (CGRect, NSRange, inout Bool) -> Void) {
if #available(macOS 12.0, iOS 15.0, *), let textLayoutManager {
textLayoutManager.enumerateLineFragments(for: rect, strictIntersection: strictIntersection) { fragmentRect, range, stop in
block(fragmentRect, range, &stop)
}
textLayoutManager.enumerateLineFragments(for: rect, strictIntersection: strictIntersection, block: block)

return
}
Expand Down

0 comments on commit a3dcc55

Please sign in to comment.