summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-05-01 08:09:51 +0200
committerGitHub <noreply@github.com>2019-05-01 08:09:51 +0200
commita8194eaef30a32a5d8595fa16b279924ce184cc9 (patch)
tree18f89b6ce8d2e3e6a184b1275674c6c771e5fc7e /scene
parent7ff0979747bd245074ab50886db575e2bd045d9a (diff)
parent48bfa9d17a69a8722556eb3a42df73348f46695c (diff)
Merge pull request #28554 from YeldhamDev/popupmenu_minsize_fix
Fix regression on 'PopupMenu's minimal size
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/popup_menu.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index 8825891807..e77ee8c744 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -93,14 +93,14 @@ Size2 PopupMenu::get_minimum_size() const {
if (items[i].submenu != "")
size.width += get_icon("submenu")->get_width();
- if (has_check)
- size.width += check_w;
- max_w = MAX(max_w, size.width + icon_w);
+ max_w = MAX(max_w, size.width);
minsize.height += size.height;
}
- minsize.width += max_w + accel_max_w;
+ minsize.width += max_w + icon_w + accel_max_w;
+ if (has_check)
+ minsize.width += check_w;
return minsize;
}