feat: long text in a column wraps to the column's width instead of being clipped - #41
Merged
Merged
Conversation
…ing clipped A stack clips what overflows it, so a long text child in a narrow column was cut off (no way to wrap without max_width). In a vertical stack, a text child wider than the slot is now word-wrapped to the inner width minus margins, keeping explicit newlines. Measured by drawing in 1-bit, since hinted glyphs are wider than getlength reports. Text that fits, with max_width, rotated, or in a row is untouched. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ld, ink-measure only near the edge, stronger tests Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ly when over The per-word estimate can be a pixel or two short for some fonts (hinting drift across spaces/digits). Every line accepted without a draw is now checked once; an overflowing one is re-wrapped with an always-draw ruler, so no font can clip a wrapped line. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tic sabotage tests Paragraphs accepted by the estimate are now verified by drawing too. The sabotage tests use a font proxy that under-reports advances by 25%, so they exercise the verification on every platform (the previous ones depended on macOS hinting and failed on Linux/Pillow 10.4). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Layout UX: in a narrow
column/card a longtextchild used to be silently clipped (stack children are cropped to the stack), and wrapping neededmax_widthcomputed by hand. A vertical stack now word-wraps atextchild that is wider than its slot (inner width minus the child's margins), keeping explicit\n. Lines are measured by drawing them in 1-bit (hinted glyphs come out wider thangetlength, which left the last glyph clipped — found by looking at the render). Untouched: text that fits,max_width, rotated text, rows (the slot width is unknown there), non-text children. Built on #40 (multi-line anchor fix).🤖 Generated with Claude Code