Skip to content

Commit

Permalink
Remove insets from scroll view (CodeEditApp#27)
Browse files Browse the repository at this point in the history
* Remove insets from scroll view

* Tidy up code slightly
  • Loading branch information
danielzsh authored May 17, 2024
1 parent e421af2 commit 39e5ae3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Sources/CodeEditTextView/TextView/TextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,9 @@ public class TextView: NSView, NSTextContent {
}

override public var visibleRect: NSRect {
if let scrollView = scrollView {
if let scrollView {
var rect = scrollView.documentVisibleRect
rect.origin.y += scrollView.contentInsets.top
rect.size.height -= scrollView.contentInsets.top + scrollView.contentInsets.bottom
return rect
} else {
return super.visibleRect
Expand Down

0 comments on commit 39e5ae3

Please sign in to comment.