Skip to content

Another text measurement fix#24669

Open
ickshonpe wants to merge 3 commits into
bevyengine:mainfrom
ickshonpe:text-measure-content-box-fix
Open

Another text measurement fix#24669
ickshonpe wants to merge 3 commits into
bevyengine:mainfrom
ickshonpe:text-measure-content-box-fix

Conversation

@ickshonpe

@ickshonpe ickshonpe commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Objective

Text is wrapped to fit inside the node's content box but the node is sized as though the text isn't wrapped.

Fixes #24664

Solution

Subtract the total of the horizontal padding and border insets.

Testing

Added the replication from #24664 to testbed_ui's TextWrap scene:

cargo run --example testbed_ui -- textwrap
image

The other examples, particularly text_debug, shouldn't demonstrate any changes.

…he content box but the node is sized as though the text isn't wrapped.

Fixed by subtracting the total inset to get the content size for measurement.
@ickshonpe ickshonpe added this to the 0.19.1 milestone Jun 19, 2026
@kfc35 kfc35 added C-Bug An unexpected or incorrect behavior A-UI Graphical user interfaces, styles, layouts, and widgets S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Jun 20, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in UI Jun 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke!
You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-24669

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

Comment thread examples/testbed/ui.rs Outdated
@dloukadakis dloukadakis added M-Deliberate-Rendering-Change An intentional change to how tests and examples are rendered S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Jun 20, 2026
Co-authored-by: Dimitrios Loukadakis <dloukadakis@users.noreply.github.com>
@ickshonpe ickshonpe added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples M-Deliberate-Rendering-Change An intentional change to how tests and examples are rendered S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

BackgroundColor does not match wrapped UI Text

4 participants