ComputedNode::resolve_clip_rect margins fix#24138
Merged
alice-i-cecile merged 4 commits intoMay 6, 2026
Merged
Conversation
…margin from `OverflowClipMargin`. This only affected picking, not rendering, as `update_clipping` calculated the clip margin itself. Fixed by inflating the clipping rect in `resolve_clip_rect` by the margin value from `OverflowClipMargin`, and removing the duplicate calculations from `update_clipping`. Also added some trivial tests.
alice-i-cecile
approved these changes
May 6, 2026
allocatedribble
added a commit
to allocatedribble/bevy
that referenced
this pull request
May 6, 2026
Cherry-pick clean upstream changes from bevyengine/bevy through 15b23b4 while leaving the destructive rewritten full upstream range unmerged. Included upstream PRs: - bevyengine#22447: update intel_tex_2 for the mipmap generator example - bevyengine#23069: update getrandom dev dependency to 0.4 - bevyengine#24142: add Disabled/Enabled state-scoped components - bevyengine#22488: move window/input-focus/custom-cursor feature ownership out of default_app - bevyengine#24144: filter tuple fields when generating BSN props - bevyengine#24138: fix UI overflow clip margin resolution - bevyengine#24139: add Rect::translate - bevyengine#24146: use array_windows for fixed-size slice windows - bevyengine#21830: document physical-pixel viewport requirements Skipped CI-only cache/action bumps because they do not improve the engine or Fun runtime surface. Validation: git diff --cached --check; cargo fmt --check -p bevy_camera -p bevy_gizmos -p bevy_input_focus -p bevy_math -p bevy_mesh -p bevy_scene -p bevy_scene_macros -p bevy_state -p bevy_ui; cargo test -p bevy_math rect_translate --lib; cargo test -p bevy_ui overflow_clip_margin --lib; cargo test -p bevy_scene scene_component_name_reference --lib; cargo check -p bevy_camera -p bevy_gizmos -p bevy_input_focus -p bevy_math -p bevy_mesh -p bevy_scene -p bevy_state -p bevy_ui; cargo check -p bevy --no-default-features --features default_app; cargo check -p bevy --no-default-features --features ui_api; downstream cargo check -p fun_render; downstream cargo check -p game_client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
The
resolve_clip_rectfunction onComputedNodewasn't adding the margin fromOverflowClipMargin. This only affected picking, not rendering, asupdate_clippinghas its own clipping calculations.Solution
resolve_clip_rectby the margin value fromOverflowClipMargin(after scaling as the margin is logical).update_clipping.Testing
Added two new tests to the
ui_nodemodule:overflow_clip_margin_boxesand overflow_clip_margin_is_logical`.