Skip to content

Fix scroll offsets ignoring borders - #25589

Open
ickshonpe wants to merge 4 commits into
bevyengine:mainfrom
ickshonpe:layout-max-scroll-limit-fix
Open

Fix scroll offsets ignoring borders#25589
ickshonpe wants to merge 4 commits into
bevyengine:mainfrom
ickshonpe:layout-max-scroll-limit-fix

Conversation

@ickshonpe

Copy link
Copy Markdown
Contributor

Objective

Scrolling shouldn't ignores border widths when clamping the scroll positions.

Look at the included regression test for a simple example.

Solution

Use the Layout::scroll_width() and Layout::scroll_height() methods provided by taffy to get the values.
Removed the .max(Vec2::ZERO), Taffy already clamps to equal or above zero so it's redundant.

Testing

New regression test: scrolling_with_borders_should_clamp_to_padding_box. Should fail on main, pass here.

@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 Aug 28, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in UI Aug 28, 2026
@Zeophlite Zeophlite added the S-Merge-Conflicts Merge conflicts :( Add this label on top of other S- labels. label Sep 1, 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-Merge-Conflicts Merge conflicts :( Add this label on top of other S- labels. 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