Skip to content

Conversation

@ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Jan 1, 2026

Objective

ComputedNode's content_inset field was changed to allocate space for the scrollbars between the content and padding areas. 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.

Testing

cargo run --example scroll --features="bevy_ui_debug"

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.

…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.
@ickshonpe ickshonpe changed the title Problem: ComputedNode's content_inset field was changed so the sp… bevy_ui_debug scrollbars fix Jan 1, 2026
@ickshonpe ickshonpe added C-Bug An unexpected or incorrect behavior A-UI Graphical user interfaces, styles, layouts, and widgets D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 1, 2026
@ickshonpe ickshonpe changed the title bevy_ui_debug scrollbars fix bevy_ui_debug scrollbars inset fix Jan 1, 2026
@ickshonpe ickshonpe added the A-Rendering Drawing game state to the screen label Jan 1, 2026
Copy link
Contributor

@kfc35 kfc35 left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen 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: No status

Development

Successfully merging this pull request may close these issues.

2 participants