Skip to content

Commit 565b21b

Browse files
committed
Fix wrong tooltip behavior in PopupMenus that have styles with top borders
1 parent 97b8ad1 commit 565b21b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scene/main/viewport.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,11 @@ String Viewport::_gui_get_tooltip(Control *p_control, const Vector2 &p_pos, Cont
14001400
// Temporary solution for PopupMenus.
14011401
PopupMenu *menu = Object::cast_to<PopupMenu>(this);
14021402
if (menu) {
1403+
Ref<StyleBox> sb = menu->get_theme_stylebox(SceneStringName(panel));
1404+
if (sb.is_valid()) {
1405+
pos.y += sb->get_margin(SIDE_TOP);
1406+
}
1407+
14031408
tooltip = menu->get_tooltip(pos);
14041409
}
14051410

0 commit comments

Comments
 (0)