You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 17:36:07 +00:00
Fix switch_on_hover for MenuButton
Previously, embedded Windows (the opened menu) were not accounted for when checking for `switch_on_hover`. `gui_get_hovered_control()` is more appropriate to check for the hover status of other `MenuButton` nodes at the mouse position. Explain the usage of the incorrectly used function in a comment.
This commit is contained in:
@@ -1630,9 +1630,11 @@ void Viewport::_gui_call_notification(Control *p_control, int p_what) {
|
||||
}
|
||||
}
|
||||
|
||||
// `gui_find_control` doesn't take embedded windows into account. So the caller of this function
|
||||
// needs to make sure, that there is no embedded window at the specified position.
|
||||
Control *Viewport::gui_find_control(const Point2 &p_global) {
|
||||
ERR_MAIN_THREAD_GUARD_V(nullptr);
|
||||
// Handle subwindows.
|
||||
|
||||
_gui_sort_roots();
|
||||
|
||||
for (List<Control *>::Element *E = gui.roots.back(); E; E = E->prev()) {
|
||||
|
||||
Reference in New Issue
Block a user