Skip to content

Commit

Permalink
Merge pull request iced-rs#1716 from iced-rs/fix/draw-base-cursor
Browse files Browse the repository at this point in the history
Fix base cursor position during `UserInterface::draw` when overlay is present
  • Loading branch information
hecrj authored Feb 18, 2023
2 parents 0d16569 + 3d8f1ad commit f0decca
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 f0decca

Please sign in to comment.