Skip to content

ImageNode measure func fixes and allow drawing inside border and padding#24154

Merged
alice-i-cecile merged 5 commits intobevyengine:mainfrom
ickshonpe:ImageNode-visual-box
May 6, 2026
Merged

ImageNode measure func fixes and allow drawing inside border and padding#24154
alice-i-cecile merged 5 commits intobevyengine:mainfrom
ickshonpe:ImageNode-visual-box

Conversation

@ickshonpe
Copy link
Copy Markdown
Contributor

@ickshonpe ickshonpe commented May 6, 2026

Objective

Allowing drawing with ImageNode inside the border and padding boxes of a UI node.
Fix a lot of image measurement and aspect ratio issues.

Fixes #24150

Solution

Renamed OverflowClipMarginBox to VisualBox.
Added a visual_box: VisualBox field to ImageNode.
Use the size of the selected node region in image rendering.
Fixed the bugs with the ImageNode measure func.

Testing

Added many more cases to testbed_ui's image and slice scenes:

cargo run --example testbed_ui -- --scene image
cargo run --example testbed_ui -- --scene slice

Showcase

box borderbox content

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

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-24154

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.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-UI Graphical user interfaces, styles, layouts, and widgets labels May 6, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in UI May 6, 2026
@alice-i-cecile alice-i-cecile added the M-Deliberate-Rendering-Change An intentional change to how tests and examples are rendered label May 6, 2026
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label May 6, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue May 6, 2026
Merged via the queue into bevyengine:main with commit 5024207 May 6, 2026
47 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in UI May 6, 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 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: Done

Development

Successfully merging this pull request may close these issues.

ImageNode should allow drawing over padding

3 participants