Improved Behavior of Nested ScrollArea
Issue:
When a ScrollArea is nested with both Horizontal and Vertical scrolling, the outer_rect can become very large due to the content, or when the content is moved. This can cause some issues.
Improvement:
There's a part that handles this with a comment, which we've simplified and made to work better.
- Related #4658
- Related #4754
- Related #4770
We could modify clip_max as follows, but we've omitted it since the ScrollArea's position changes.
let clip_max = ui.clip_rect().max[1 - d] - ui.style().spacing.item_spacing[1 - d];
As I said in https://github.com/emilk/egui/pull/4770 and https://github.com/emilk/egui/pull/4658:
We need a proper test for this, otherwise we will just go around in circles. ScrollArea is getting way to complex.
The test could be a manual one (in https://github.com/emilk/egui/blob/master/tests/) for now.
As I said in #4770 and #4658:
We need a proper test for this, otherwise we will just go around in circles.
ScrollAreais getting way to complex.The test could be a manual one (in https://github.com/emilk/egui/blob/master/tests/) for now.
This is as simplified as possible. I tested it for a long time without any problems. Please review.
completed.