diff options
author | 2023-02-18 21:52:08 +0100 | |
---|---|---|
committer | 2023-02-18 21:52:08 +0100 | |
commit | 3d8f1ad238cea6faaa168a3be516097e5817b9c2 (patch) | |
tree | ca57c305d074e99aadadfb8aaef40a8f30647d14 /native | |
parent | 0d1656937b459237670cdc0b1f45e09d78c47494 (diff) | |
download | iced-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.rs | 13 |
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); |