-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
bevy_ui_debug scrollbars inset fix
#22343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bevy_ui_debug scrollbars inset fix
#22343
Conversation
…ace allocated for the scrollbars is no longer in the scrolling area. The UI debug overlay expects the content_insets to include that space and as a result wrongly draws the scrollbars inset into the content box by their width. Solution: Use `ComputedNode`'s `horizontal_scrollbar` and `vertical_scrollbar` methods to position the debug overlay's scroll bar rects instead.
ComputedNode's content_inset field was changed so the sp…bevy_ui_debug scrollbars fix
bevy_ui_debug scrollbars fixbevy_ui_debug scrollbars inset fix
kfc35
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic looks good, also verified via cargo run --example scroll --features=“bevy_ui_debug” that everything looks good on the branch vs main
mardzie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and works.
Objective
ComputedNode'scontent_insetfield was changed to allocate space for the scrollbars between the content and padding areas. The UI debug overlay expects thecontent_insetsto include that space and as a result wrongly draws the scrollbars inset into the content box by their width.Solution
Use
ComputedNode'shorizontal_scrollbarandvertical_scrollbarmethods to position the debug overlay's scroll bar rects instead.Testing
On main you should see a gap between the the vertical scrollbar and the right edge of the node.
With this PR, the gap should be gone.