New method to determine if overlay contains cursor
This is needed for "container" overlay's such as `Group` which should only consider it's childrens layouts and not it's own when determining if the cursor is captured by the overlay.
This commit is contained in:
parent
b2a3a85acb
commit
3ab6797255
4 changed files with 48 additions and 2 deletions
|
|
@ -89,6 +89,15 @@ where
|
|||
) -> mouse::Interaction {
|
||||
mouse::Interaction::Idle
|
||||
}
|
||||
|
||||
/// Whether the [`Overlay`] contains the cursor
|
||||
fn contains_cursor(
|
||||
&self,
|
||||
layout: Layout<'_>,
|
||||
cursor_position: Point,
|
||||
) -> bool {
|
||||
layout.bounds().contains(cursor_position)
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a [`Group`] of overlay [`Element`] children.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue