egui icon indicating copy to clipboard operation
egui copied to clipboard

Improved Behavior of Nested ScrollArea

Open rustbasic opened this issue 1 year ago • 3 comments

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];

rustbasic avatar Jul 06 '24 04:07 rustbasic

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.

emilk avatar Jul 15 '24 06:07 emilk

As I said in #4770 and #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.

This is as simplified as possible. I tested it for a long time without any problems. Please review.

rustbasic avatar Jul 15 '24 08:07 rustbasic

completed.

rustbasic avatar Aug 02 '24 17:08 rustbasic