Skip to content

ImageMeasure border-box sizing fix#24674

Open
ickshonpe wants to merge 4 commits into
bevyengine:mainfrom
ickshonpe:image-measure-borderbox-fix
Open

ImageMeasure border-box sizing fix#24674
ickshonpe wants to merge 4 commits into
bevyengine:mainfrom
ickshonpe:image-measure-borderbox-fix

Conversation

@ickshonpe

@ickshonpe ickshonpe commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Objective

On main (without the changes to the measure function in this PR) absolutely positioned nodes are sized to fit the image to their border-box not content-box:

absbroke

(from the new testbed_ui scene, ImageMeasure included with this PR). Only the 3rd and 6th image nodes in this layout were given any vertical padding, but extra vertical padding is given to all of the nodes except the first (which doesn't have a border so its border-box and content-box are the same size).

Solution

Remove the known width guards from ImageMeasure's border-box calculations:

absfix

Testing

cargo run --example testbed_ui -- imagemeasure

Added an `ImageMeasure` scene to testbed_ui for testing.
@ickshonpe ickshonpe added C-Bug An unexpected or incorrect behavior A-UI Graphical user interfaces, styles, layouts, and widgets labels Jun 20, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in UI Jun 20, 2026
@ickshonpe ickshonpe added D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 20, 2026
@ickshonpe ickshonpe added this to the 0.19.1 milestone 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 S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

2 participants