Repository navigation
Keep Middle/Bottom vertical alignment for wrapped text taller than its row - #1371
Merged
aiongg merged 1 commit intoOct 22, 2026
Conversation
…s row Fixes storytold#1347 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> 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.
Fixes #1347
Cause
wrapped_cell_text_yclamped the bottom-aligned Y to the top-aligned Y. When wrapped text was taller than its row, Middle and Bottom came out the same as Top, so the text always sat at the top of the cell.Fix
Removed the clamp. Taller text now overflows upward for Bottom and both ways for Middle, anchored to the cell's bottom edge or centre, and the cell's existing clip rect trims it. The old overflow test asserted the clamped behaviour, so it now checks that Top still starts inside the cell.
Verified
wrapped_cell_text_y_keeps_vertical_alignment_when_text_is_taller_than_the_row: fails onmainwithout the fix and passes with it (cargo test -p gridcraft-ui-egui --lib wrapped_cell_text_y_keeps_vertical_alignment_when_text_is_taller_than_the_row).cargo xtask cipasses.Not changed
cell_text_y, which handles unwrapped single-line text, still has the same clamp. Text that fits its row, rotated text, and the engine'shome.alignTop/Middle/Bottomcommands are unchanged.🤖 Generated with Claude Code