Fix wrong tooltip behavior in PopupMenus that have styles with top borders

This commit is contained in:
Michael Alexsander 2024-04-19 21:08:16 -03:00
parent 97b8ad1af0
commit 565b21b116
No known key found for this signature in database
GPG key ID: A9C91EE110F4EABA

View file

@ -1400,6 +1400,11 @@ String Viewport::_gui_get_tooltip(Control *p_control, const Vector2 &p_pos, Cont
// Temporary solution for PopupMenus.
PopupMenu *menu = Object::cast_to<PopupMenu>(this);
if (menu) {
Ref<StyleBox> sb = menu->get_theme_stylebox(SceneStringName(panel));
if (sb.is_valid()) {
pos.y += sb->get_margin(SIDE_TOP);
}
tooltip = menu->get_tooltip(pos);
}