Skip to content

Keep Middle/Bottom vertical alignment for wrapped text taller than its row - #1371

Merged
aiongg merged 1 commit into
storytold:mainfrom
Silvertree2010:fix/1347-bug-report-gridcraft-gridcarft-v
Oct 22, 2026
Merged

aiongg merged 1 commit into
storytold:mainfrom
Silvertree2010:fix/1347-bug-report-gridcraft-gridcarft-v

Conversation

@Silvertree2010

Copy link
Copy Markdown
Contributor

Fixes #1347

Cause

wrapped_cell_text_y clamped 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

  • Regression test wrapped_cell_text_y_keeps_vertical_alignment_when_text_is_taller_than_the_row: fails on main without 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 ci passes.

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's home.alignTop/Middle/Bottom commands are unchanged.

🤖 Generated with Claude Code

…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>
@aiongg
aiongg merged commit 116cc86 into storytold:main Oct 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report] [GridCraft] GridCarft v0.7.0 || Text does not work to stay up, middle and down the line.

2 participants