Introduce internal overlay::Nested for UserInterface

This commit is contained in:
Cory Forsstrom 2023-02-18 14:31:38 -08:00 committed by Héctor Ramón Jiménez
parent 329fbc7b21
commit 55dc3b5619
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
9 changed files with 406 additions and 41 deletions

View file

@ -147,11 +147,18 @@ where
});
}
fn is_over(&self, layout: Layout<'_>, cursor_position: Point) -> bool {
fn is_over(
&self,
layout: Layout<'_>,
renderer: &Renderer,
cursor_position: Point,
) -> bool {
self.children
.iter()
.zip(layout.children())
.any(|(child, layout)| child.is_over(layout, cursor_position))
.any(|(child, layout)| {
child.is_over(layout, renderer, cursor_position)
})
}
}