summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-18 21:52:08 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-18 21:52:08 +0100
commit3d8f1ad238cea6faaa168a3be516097e5817b9c2 (patch)
treeca57c305d074e99aadadfb8aaef40a8f30647d14 /native
parent0d1656937b459237670cdc0b1f45e09d78c47494 (diff)
downloadiced-3d8f1ad238cea6faaa168a3be516097e5817b9c2.tar.gz
iced-3d8f1ad238cea6faaa168a3be516097e5817b9c2.tar.bz2
iced-3d8f1ad238cea6faaa168a3be516097e5817b9c2.zip
Fix base cursor position during `UserInterface::draw` when overlay is present
Diffstat (limited to 'native')
-rw-r--r--native/src/user_interface.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/native/src/user_interface.rs b/native/src/user_interface.rs
index f5202609..68ccda55 100644
--- a/native/src/user_interface.rs
+++ b/native/src/user_interface.rs
@@ -440,12 +440,13 @@ where
overlay.layout(renderer, self.bounds, Vector::ZERO)
});
- let new_cursor_position =
- if overlay_layout.bounds().contains(cursor_position) {
- Point::new(-1.0, -1.0)
- } else {
- cursor_position
- };
+ let new_cursor_position = if overlay
+ .is_over(Layout::new(&overlay_layout), cursor_position)
+ {
+ Point::new(-1.0, -1.0)
+ } else {
+ cursor_position
+ };
self.overlay = Some(overlay_layout);