Skip to content

Commit 5dac8e4

Browse files
committed
TextLayoutManager: Reduce viewport top inset
The STTextView's viewport inset is reduced from half the visible height to a quarter of the visible height. This improves performance by preparing a smaller area of content ahead of the currently visible region.
1 parent 5c0e0fe commit 5dac8e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/STTextViewAppKit/STTextView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ import AVFoundation
824824
}
825825

826826
open override func prepareContent(in rect: NSRect) {
827-
var insetRect = rect.inset(dy: -visibleRect.height / 2)
827+
var insetRect = rect.inset(dy: -visibleRect.height / 4)
828828
insetRect.origin = CGPoint(x: max(0, insetRect.origin.x), y: max(insetRect.origin.y, 0))
829829
super.prepareContent(in: insetRect)
830830
layoutViewport()

0 commit comments

Comments
 (0)