Decide whether to clip to visible bounds on a per-element basis
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
eb711cde53
commit
45d118f96f
8 changed files with 18 additions and 12 deletions
|
@ -261,7 +261,8 @@ impl Element for List {
|
|||
scroll_top: &mut ListOffset,
|
||||
cx: &mut PaintContext,
|
||||
) {
|
||||
cx.scene.push_layer(Some(bounds));
|
||||
let visible_bounds = visible_bounds.intersection(bounds).unwrap_or_default();
|
||||
cx.scene.push_layer(Some(visible_bounds));
|
||||
|
||||
cx.scene
|
||||
.push_mouse_region(MouseRegion::new::<Self>(10, 0, bounds).on_scroll({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue