-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
scroll_with_delta
doesn't work
#2783
Comments
It looks like this is the code that handles the egui/crates/egui/src/containers/scroll_area.rs Lines 700 to 716 in f94187a
It only takes the delta into account if the pointer is inside the scroll area, so the example will never work, since you have to click a button that is outside the area. If I remove this condition, it works as intended. I don't know why it is written this way, and both the code above and the I suspect that since the Edit: actually, the |
…used (#4303) <!-- Please read the "Making a PR" section of [`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md) before opening a Pull Request! * Keep your PR:s small and focused. * The PR title is what ends up in the changelog, so make it descriptive! * If applicable, add a screenshot or gif. * If it is a non-trivial addition, consider adding a demo for it to `egui_demo_lib`, or a new example. * Do NOT open PR:s from your `master` branch, as that makes it hard for maintainers to add commits to your PR. * Remember to run `cargo fmt` and `cargo cranky`. * Open the PR as a draft until you have self-reviewed it and run `./scripts/check.sh`. * When you have addressed a PR comment, mark it as resolved. Please be patient! I will review your PR, but my time is limited! --> This introduces the boolean field force_current_scroll_area to InputState which will be set when scroll_with_delta is called, causing the ScrollArea to skip the check whether it is focused and always consume the smooth scroll delta. * Closes #2783 * Related to #4295 --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
…used (emilk#4303) <!-- Please read the "Making a PR" section of [`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md) before opening a Pull Request! * Keep your PR:s small and focused. * The PR title is what ends up in the changelog, so make it descriptive! * If applicable, add a screenshot or gif. * If it is a non-trivial addition, consider adding a demo for it to `egui_demo_lib`, or a new example. * Do NOT open PR:s from your `master` branch, as that makes it hard for maintainers to add commits to your PR. * Remember to run `cargo fmt` and `cargo cranky`. * Open the PR as a draft until you have self-reviewed it and run `./scripts/check.sh`. * When you have addressed a PR comment, mark it as resolved. Please be patient! I will review your PR, but my time is limited! --> This introduces the boolean field force_current_scroll_area to InputState which will be set when scroll_with_delta is called, causing the ScrollArea to skip the check whether it is focused and always consume the smooth scroll delta. * Closes emilk#2783 * Related to emilk#4295 --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Describe the bug
scroll_with_delta
doesn't seem to work.To Reproduce
Steps to reproduce the behavior:
eframe
.scroll_with_delta
example from documentation.Scroll down
button.Expected behavior
Content scrolls down.
Screenshots
untitled.webm
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: