diff options
Diffstat (limited to 'scene/gui/popup_menu.cpp')
-rw-r--r-- | scene/gui/popup_menu.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 6ac6eac655..e3f26e0f0b 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -108,6 +108,11 @@ Size2 PopupMenu::get_minimum_size() const { accel_max_w = MAX(accel_w, accel_max_w); } + if (items[i].submenu != "") { + + size.width += get_icon("submenu")->get_width(); + } + minsize.height += size.height; max_w = MAX(max_w, size.width); } @@ -273,7 +278,7 @@ void PopupMenu::_gui_input(const InputEvent &p_event) { Point2 pos = get_position(); int s = (vseparation + font->get_height()) * 3; - pos.y -= s; + pos.y -= (s * b.factor); set_position(pos); //update hover @@ -293,7 +298,7 @@ void PopupMenu::_gui_input(const InputEvent &p_event) { Point2 pos = get_position(); int s = (vseparation + font->get_height()) * 3; - pos.y += s; + pos.y += (s * b.factor); set_position(pos); //update hover |