summaryrefslogtreecommitdiffstats
path: root/native/src/user_interface.rs
diff options
context:
space:
mode:
authorLibravatar Cory Forsstrom <cforsstrom18@gmail.com>2023-01-17 11:12:10 -0800
committerLibravatar Cory Forsstrom <cforsstrom18@gmail.com>2023-01-17 11:12:10 -0800
commit3ab679725526bd095cc1a160705312b16c408b92 (patch)
tree15822dd3684c6f5d1892eb5b15385157dbf72f08 /native/src/user_interface.rs
parentb2a3a85acb2a0722e90c46b70d574f1d676da9d1 (diff)
downloadiced-3ab679725526bd095cc1a160705312b16c408b92.tar.gz
iced-3ab679725526bd095cc1a160705312b16c408b92.tar.bz2
iced-3ab679725526bd095cc1a160705312b16c408b92.zip
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.
Diffstat (limited to '')
-rw-r--r--native/src/user_interface.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/native/src/user_interface.rs b/native/src/user_interface.rs
index 29cc3472..8659caa3 100644
--- a/native/src/user_interface.rs
+++ b/native/src/user_interface.rs
@@ -261,7 +261,11 @@ where
}
}
- let base_cursor = if layout.bounds().contains(cursor_position) {
+ let base_cursor = if manual_overlay
+ .as_ref()
+ .unwrap()
+ .contains_cursor(Layout::new(&layout), cursor_position)
+ {
// TODO: Type-safe cursor availability
Point::new(-1.0, -1.0)
} else {
@@ -504,7 +508,10 @@ where
);
});
- if overlay_bounds.contains(cursor_position) {
+ if overlay.contains_cursor(
+ Layout::new(layout),
+ cursor_position,
+ ) {
overlay_interaction
} else {
base_interaction