Skip to content

Fix wrapped UI text auto height - #49

Merged
Milky2018 merged 1 commit into
moonbit-community:mainfrom
kkkiio:agent/fix-wrapped-ui-text-auto-height
Jul 22, 2026
Merged

Fix wrapped UI text auto height#49
Milky2018 merged 1 commit into
moonbit-community:mainfrom
kkkiio:agent/fix-wrapped-ui-text-auto-height

Conversation

@kkkiio

@kkkiio kkkiio commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Share the existing wrap and truncation helpers between Taffy leaf measurement and UI rendering.
  • Measure automatic text height from prepared lines using the logical content width, including padding and border insets.

The leaf measure callback previously measured the full string as one line and ignored TextLayout. Rendering then wrapped against the final content rect, so Taffy could record a 16px height while two 16px lines were drawn. The change keeps the existing text helpers in place and adds prepare_text_layout as the shared orchestration layer. Taffy per-tree leaf measurement caching remains unchanged; no persistent cache is added.

Fixes #48

Checks

  • moon check src/ui --target all --deny-warn
  • moon test src/ui --target native --release --deny-warn

@kkkiio
kkkiio marked this pull request as ready for review July 21, 2026 15:27
@Milky2018
Milky2018 merged commit 44ec971 into moonbit-community:main Jul 22, 2026
0 of 3 checks passed
@Milky2018

Copy link
Copy Markdown
Collaborator

Thanks for the contribution. This was merged with an additional end-to-end regression covering the final computed node height, not only the leaf measurement helper. UI tests pass on the current Chicle backend, and the fix is available in Selene 0.37.0.

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.

Wrapped UI text keeps a single-line auto height

2 participants