Fix two ScrollArea bugs: leaking scroll target and broken animation to target offset#4174
Merged
Fix two ScrollArea bugs: leaking scroll target and broken animation to target offset#4174
ScrollArea bugs: leaking scroll target and broken animation to target offset#4174Conversation
Merged
6 tasks
emilk
approved these changes
Mar 17, 2024
abey79
added a commit
to rerun-io/rerun
that referenced
this pull request
Mar 18, 2024
…item (#5494) ### What - Follow up to #5482 - Fixes #5232 This PR adds support for expanding and scrolling to the focus item in the Streams view. It also adds expanding/scrolling the Blueprint tree when focusing on a component. - Blocked on emilk/egui#4174 TODO: - [x] update egui commit once ☝🏻 is merged https://github.com/rerun-io/rerun/assets/49431240/55c2959f-bb9b-4f67-b20b-06ba82175d71 ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using newly built examples: [app.rerun.io](https://app.rerun.io/pr/5494/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/5494/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [app.rerun.io](https://app.rerun.io/pr/5494/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! - [PR Build Summary](https://build.rerun.io/pr/5494) - [Docs preview](https://rerun.io/preview/e879778c92dd2e50eb05bc6fdefee9ac79b93872/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/e879778c92dd2e50eb05bc6fdefee9ac79b93872/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
hacknus
pushed a commit
to hacknus/egui
that referenced
this pull request
Oct 30, 2024
… to target offset (emilk#4174) This PR fixes two issues related to `ScrollArea`. 1) When a `ScrollArea` would have `drag_to_scroll` set to `false` (e.g. because some custom logic is at play or some other reason), it would not animate to the `target_offset`, effectively making `Response::scroll_to_me()` ineffective. 2) Single-direction `ScrollArea`s would leak the `scroll_target`'s other direction. In certain specific circumstances (e.g. an horizontal area nested in a vertical one, or inversely), this _could_ work as intended, but in many other cases it could cause unwanted effects. With this PR, both `scroll_target` directions are consumed by nearest enclosing `ScrollArea`, regardless of the actually enabled scroll axes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes two issues related to
ScrollArea.ScrollAreawould havedrag_to_scrollset tofalse(e.g. because some custom logic is at play or some other reason), it would not animate to thetarget_offset, effectively makingResponse::scroll_to_me()ineffective.ScrollAreas would leak thescroll_target's other direction. In certain specific circumstances (e.g. an horizontal area nested in a vertical one, or inversely), this could work as intended, but in many other cases it could cause unwanted effects. With this PR, bothscroll_targetdirections are consumed by nearest enclosingScrollArea, regardless of the actually enabled scroll axes.