Skip to content

Commit

Permalink
Fix base cursor position during UserInterface::draw when overlay is…
Browse files Browse the repository at this point in the history
… present
  • Loading branch information
hecrj committed Feb 18, 2023
1 parent 0d16569 commit 3d8f1ad
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions native/src/user_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 3d8f1ad

Please sign in to comment.