From 3ab679725526bd095cc1a160705312b16c408b92 Mon Sep 17 00:00:00 2001 From: Cory Forsstrom Date: Tue, 17 Jan 2023 11:12:10 -0800 Subject: 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. --- native/src/user_interface.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'native/src/user_interface.rs') 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 -- cgit