Fix base cursor position during UserInterface::draw when overlay is present

This commit is contained in:
Héctor Ramón Jiménez 2023-02-18 21:52:08 +01:00
parent 0d1656937b
commit 3d8f1ad238
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -440,12 +440,13 @@ where
overlay.layout(renderer, self.bounds, Vector::ZERO) overlay.layout(renderer, self.bounds, Vector::ZERO)
}); });
let new_cursor_position = let new_cursor_position = if overlay
if overlay_layout.bounds().contains(cursor_position) { .is_over(Layout::new(&overlay_layout), cursor_position)
Point::new(-1.0, -1.0) {
} else { Point::new(-1.0, -1.0)
cursor_position } else {
}; cursor_position
};
self.overlay = Some(overlay_layout); self.overlay = Some(overlay_layout);