From 04ea79c738b02596a701bb7e7712448bcd67b142 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Sat, 15 Dec 2018 18:48:10 -0200 Subject: [PATCH] Fix item highlighting in PopupMenu for items with offset --- scene/gui/popup_menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index f621522102a..82d6e6480ef 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -453,7 +453,6 @@ void PopupMenu::_notification(int p_what) { Color icon_color(1, 1, 1, items[i].disabled ? 0.5 : 1); - item_ofs.x += items[i].h_ofs; if (!items[i].icon.is_null()) { icon_size = items[i].icon->get_size(); @@ -470,6 +469,7 @@ void PopupMenu::_notification(int p_what) { String text = items[i].shortcut.is_valid() ? String(tr(items[i].shortcut->get_name())) : items[i].xl_text; + item_ofs.x += items[i].h_ofs; if (items[i].separator) { int sep_h = separator->get_center_size().height + separator->get_minimum_size().height;