fix oneline overflow (copy from pr#226)#229
Merged
andydotxyz merged 2 commits intogo-text:mainfrom Feb 12, 2026
Merged
Conversation
fix oneline overflow
Contributor
Author
|
The checks are still waiting. I dont know how to fix this. |
Closed
andydotxyz
approved these changes
Feb 12, 2026
benoitkugler
added a commit
that referenced
this pull request
Feb 23, 2026
Merged
benoitkugler
added a commit
that referenced
this pull request
Feb 23, 2026
* [font] Reorder extents lookup order * [shaping] extends fix in #229 to WrapNextLine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have discovered this bug when updating go-text/typesetting to v0.3.3 and the gioui/widget.Editor SingleLine=true stopped working and text was displayed vertical one character per line. I have traced it to widget/text.go line 246-254.
Which caused and overflow in text/gotext.go line 514.
which progressed to shaping/wrapping.go from github.com/go-text/typesetting v 0.3.3, where the overflow occurs.
fixed.I(maxWidth)->-64whenmaxWidthismath.MaxIntThe error before the fix was applied.
--- FAIL: TestWrapping_oneLine_overflow_bug (0.00s) wrapping_test.go:3614: expected one line, got 2 wrapping_test.go:3620: expected no line, got 2I have created a safety check for the overflow and created a test to verify