Merge pull request #1716 from iced-rs/fix/draw-base-cursor

Fix base cursor position during `UserInterface::draw` when overlay is present
This commit is contained in:
Héctor Ramón 2023-02-18 22:05:31 +01:00 committed by GitHub
commit f0decca8bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);