Skip to content

Commit

Permalink
Map the visible rect to the text container by subtracting the text co…
Browse files Browse the repository at this point in the history
…ntainer's origin from the visible rect's origin. (#10)
  • Loading branch information
danielpunkass authored Aug 23, 2022
1 parent 5c6b1d9 commit 884cd21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Neon/TextContainerSystemInterface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extension NSTextView {
}

let origin = textContainerOrigin
let offsetRect = rect.offsetBy(dx: origin.x, dy: origin.y)
let offsetRect = rect.offsetBy(dx: -origin.x, dy: -origin.y)

let glyphRange = layoutManager.glyphRange(forBoundingRect: offsetRect, in: container)

Expand Down

0 comments on commit 884cd21

Please sign in to comment.