Fix wrong tooltip behavior in `PopupMenu`s that have styles with top borders
@@ -1539,6 +1539,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);
}