Fix bug in ui.ui_contains_mouse
This commit is contained in:
parent
96b70b6971
commit
752c321a61
1 changed files with 2 additions and 6 deletions
|
@ -415,13 +415,9 @@ impl Ui {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Is the mouse above this `Ui`?
|
/// Is the mouse above this `Ui`?
|
||||||
|
/// Equivalent to `ui.rect_contains_mouse(ui.min_rect())`
|
||||||
pub fn ui_contains_mouse(&self) -> bool {
|
pub fn ui_contains_mouse(&self) -> bool {
|
||||||
if let Some(mouse_pos) = self.input().mouse.pos {
|
self.rect_contains_mouse(self.min_rect())
|
||||||
self.clip_rect().contains(mouse_pos)
|
|
||||||
&& self.ctx().layer_id_at(mouse_pos) == Some(self.layer_id())
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deprecated = "Use: interact(rect, id, Sense::hover())"]
|
#[deprecated = "Use: interact(rect, id, Sense::hover())"]
|
||||||
|
|
Loading…
Reference in a new issue