From c8eca416654cfbc6c9e476e3193242460bc3b51a Mon Sep 17 00:00:00 2001 From: Daniel Zhu Date: Thu, 2 May 2024 22:55:35 -0700 Subject: [PATCH 1/2] Remove insets from scroll view --- Sources/CodeEditTextView/TextView/TextView.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Sources/CodeEditTextView/TextView/TextView.swift b/Sources/CodeEditTextView/TextView/TextView.swift index 13b3a5b7..ae6a6fb7 100644 --- a/Sources/CodeEditTextView/TextView/TextView.swift +++ b/Sources/CodeEditTextView/TextView/TextView.swift @@ -458,7 +458,6 @@ public class TextView: NSView, NSTextContent { if let scrollView = 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 From 0369880d6245d0d5ab2ad9c41427d1565f74e8c9 Mon Sep 17 00:00:00 2001 From: Daniel Zhu Date: Thu, 2 May 2024 23:11:36 -0700 Subject: [PATCH 2/2] Tidy up code slightly --- Sources/CodeEditTextView/TextView/TextView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/CodeEditTextView/TextView/TextView.swift b/Sources/CodeEditTextView/TextView/TextView.swift index ae6a6fb7..22af96c2 100644 --- a/Sources/CodeEditTextView/TextView/TextView.swift +++ b/Sources/CodeEditTextView/TextView/TextView.swift @@ -455,7 +455,7 @@ 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 return rect