Commit d87d491
Fix bevy_ui_widgets scrollbar bug where scrollbar_size wasn't taken into account (#21835)
# Objective
Bevy ui widget scrollbar implementation didn't correctly handle
scrollbar width inserted by taffy.
## Solution
Correctly handle scrollbar width similarly as it is done in bevy engine
scroll position calculation:
https://github.com/bevyengine/bevy/blob/0d46518eb21df54ba951f503930501bc2639e2a2/crates/bevy_ui/src/layout/mod.rs#L334-L336
## Testing
- In personal project added scrollareas with scrollbars that
automatically attach to overflow: scroll elements and utilize space
provided by taffy scrollbar-width.
Co-authored-by: Alice Cecile <[email protected]>1 parent a1c4943 commit d87d491
1 file changed
+8
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| |||
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
196 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
197 | 200 | | |
| 201 | + | |
198 | 202 | | |
199 | 203 | | |
200 | 204 | | |
| |||
250 | 254 | | |
251 | 255 | | |
252 | 256 | | |
253 | | - | |
| 257 | + | |
| 258 | + | |
254 | 259 | | |
255 | 260 | | |
256 | 261 | | |
| |||
0 commit comments