-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix scroll handle extending outside of ScrollArea
#5286
base: master
Are you sure you want to change the base?
Fix scroll handle extending outside of ScrollArea
#5286
Conversation
Preview available at https://egui-pr-preview.github.io/pr/5286-fix-scroll-handle-overlap |
While this is a improvement, now it will look like you're at the top while already scrolled done by some amount: Bildschirmaufnahme.2024-10-20.um.17.22.48.movIdeally, the scrollbar position would just be calculated correctly, taking the min size into account. |
Oh, you're totally right. I didn't notice this behaviour 🥲 I'll work on a fix for this |
I did an update to the PR. 1º - I extracted the handle_rect calculation to a function scroll_use.mp4 |
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.
Awesome, it's working perfectly now, thank you for this! 🚀 I think we can merge this once the pipeline succeeds.
ScrollArea
I did two more commits: |
Seems like you'll need to do another format. Usually it makes more sense to run rustfmt last after any other changes |
Indeed. I'm using RusRover, and for some reason, the format is different than: cargo fmt. Maybe they are using some format of their own. |
Oh... That is nice. I'll toggle it. Thank you ^^ |
Info
This PR addresses an issue where resizing a scroll handle can lead to unwanted overlap.
It is also happening on the egui-demo.
Cause
Note: The following explanation assumes a vertical scroll; however, the logic applies equally to horizontal scrolling.
When the scroll handle is positioned at the top or bottom of the scroll area and the handle is resized to fit the minimum handle size, there is a risk of overlap. This occurs if the handle’s new size extends beyond the bounds of the scroll area.
Proposed Solution