Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd51f3ad

Browse files
Don't Try to Set a Negative Frame Height (#96)
### DescriptionFixes a potential recursion where CETV tries to set it's frame to a negative number (due to overscroll & scroll inset weirdness). This adds a super simple sanity check to make sure we limit the textview to a `0` frame at minimum.This hang would occur when no content is present, making the content size an odd number, which also makes scroll views freak out on macOS.### Related Issues*CodeEditApp/CodeEdit#2049### Checklist- [x] I read and understood the [contributing guide](https://github.com/CodeEditApp/CodeEdit/blob/main/CONTRIBUTING.md) as well as the [code of conduct](https://github.com/CodeEditApp/CodeEdit/blob/main/CODE_OF_CONDUCT.md)- [x] The issues this PR addresses are related to each other- [x] My changes generate no new warnings- [x] My code builds and runs on my machine- [x] My changes are all related to the related issue above- [x] I documented my code### ScreenshotsN/A, fixes a hang.
1 parentd82b1c0 commitd51f3ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎Sources/CodeEditTextView/TextView/TextView+Layout.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ extension TextView {
7272
availableSize.height-=(scrollView?.contentInsets.top??0)+(scrollView?.contentInsets.bottom??0)
7373

7474
letextraHeight= availableSize.height* overscrollAmount
75-
letnewHeight=max(layoutManager.estimatedHeight()+ extraHeight, availableSize.height)
75+
letnewHeight=max(layoutManager.estimatedHeight()+ extraHeight, availableSize.height,0)
7676
letnewWidth= layoutManager.estimatedWidth()
7777

7878
vardidUpdate=false

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp