Skip to content

Commit 2fc1076

Browse files
Remove overscroll boolean
1 parent 437fadb commit 2fc1076

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

Sources/CodeEditTextView/TextView/TextView+Layout.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ extension TextView {
6565
var availableSize = scrollView?.contentSize ?? .zero
6666
availableSize.height -= (scrollView?.contentInsets.top ?? 0) + (scrollView?.contentInsets.bottom ?? 0)
6767

68-
let extraHeight = overscroll ? availableSize.height * overscrollAmount : 0
68+
let extraHeight = availableSize.height * overscrollAmount
6969
let newHeight = max(layoutManager.estimatedHeight() + extraHeight, availableSize.height)
7070
let newWidth = layoutManager.estimatedWidth()
7171

Sources/CodeEditTextView/TextView/TextView.swift

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,13 @@ public class TextView: NSView, NSTextContent {
107107
}
108108
}
109109

110-
/// Determines if the text view should allow scrolling past the end of the document
111-
public var overscroll: Bool = true {
112-
didSet {
113-
updateFrameIfNeeded()
114-
}
115-
}
116-
117110
/// The amount of extra space to add when overscroll is enabled, as a percentage of the viewport height
118111
public var overscrollAmount: CGFloat = 0.5 {
119112
didSet {
120-
if overscroll {
121-
updateFrameIfNeeded()
113+
if overscrollAmount < 0 {
114+
overscrollAmount = 0
122115
}
116+
updateFrameIfNeeded()
123117
}
124118
}
125119

0 commit comments

Comments
 (0)