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:
commit
f0decca8bc
1 changed files with 7 additions and 6 deletions
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue