From 1478adba55a9e94804691c06114052ffed6bbf1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=B8vring?= Date: Wed, 4 May 2022 20:56:22 +0200 Subject: [PATCH] Disables horizontal overscroll when line wrapping is enabled --- Sources/Runestone/TextView/TextView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Runestone/TextView/TextView.swift b/Sources/Runestone/TextView/TextView.swift index 7a551675c..b371ee7f8 100644 --- a/Sources/Runestone/TextView/TextView.swift +++ b/Sources/Runestone/TextView/TextView.swift @@ -512,7 +512,7 @@ public final class TextView: UIScrollView { let horizontalOverscrollLength = max(frame.width * horizontalOverscrollFactor, 0) let verticalOverscrollLength = max(frame.height * verticalOverscrollFactor, 0) let baseContentSize = textInputView.contentSize - let width = baseContentSize.width + horizontalOverscrollLength + let width = isLineWrappingEnabled ? baseContentSize.width : baseContentSize.width + horizontalOverscrollLength let height = baseContentSize.height + verticalOverscrollLength return CGSize(width: width, height: height) }