Merge pull request #24379 from YeldhamDev/popupmenu_itemofs_highlight_fix

Fix item highlighting in PopupMenu for items with offset
This commit is contained in:
Rémi Verschelde 2018-12-16 14:29:37 +01:00 committed by GitHub
commit f00c5c00d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;