bevy/release-content
ickshonpe d195116426
Improved UI scrolling support and bug fixes (#20093)
# Objective

#### Goals
* Stop layout updates from overwriting `ScrollPosition`.
* Make `ScrollPosition` respect scale factor.
* Automatically allocate space for a scrollbar on an axis when
`OverflowAxis::Scroll` is set.
 
#### Non-Goals
* Overflow-auto support (I was certain Taffy had this already, but
apparently I was hallucinating).
* Implement any sort of scrollbar widgets.
* Stability (not needed because no overflow-auto support).
* Maybe in the future we could make a `ScrollbarWidth` enum to more
closely match the CSS API with its auto/narrow/none options. For now
`scrollbar_width` is just an `f32` which matches Taffy's API.

## Solution

* Layout updates no longer overwrite `ScrollPosition`'s value.
* Added the field `scrollbar_width: f32` to `Node`. This is sent to
`Taffy` which will automatically allocate space for scrollbars with this
width in the layout as needed.
* Added the fields `scrollbar_width: f32` and `scroll_position: Vec2` to
`ComputedNode`. These are updated automatically during layout.
* `ScrollPosition` now respects scale factor.
* `ScrollPosition` is no longer automatically added to every UI node
entity by `ui_layout_system`. If every node needs it, it should just be
required by (or be a field on) `Node`. Not sure if that's necessary or
not.

## Testing
For testing you can look at:
* The `scrollbars` example, which should work as before.
* The new example `drag_to_scroll`.
* The `scroll` example which automatically allocates space for
scrollbars on the left hand scrolling list. Did not implement actual
scrollbars so you'll just see a gap atm.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2025-07-15 17:33:04 +00:00
..
migration-guides Improved UI scrolling support and bug fixes (#20093) 2025-07-15 17:33:04 +00:00
release-notes Improved UI scrolling support and bug fixes (#20093) 2025-07-15 17:33:04 +00:00
migration_guides_template.md Make some changes to the migration guide recommendations (#18794) 2025-04-10 19:25:56 +00:00
migration_guides.md bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
README.md Fixed broken link in release content README. (#19375) 2025-05-26 19:30:03 +00:00
release_notes_template.md Add basic release content tagging workflow (#18568) 2025-03-27 17:46:39 +00:00
release_notes.md bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00

Release Content

This directory contains drafts of documentation for the current development cycle, which will be published to the website during the next release. You can find more information in the release notes and migration guides files.