diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-01-04 19:54:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-04 19:54:19 +0100 |
commit | 92e114edfdf45aa311f7b8326d286998365b6bfa (patch) | |
tree | 373e6643eca624f24909e2798121c1f6b790c4f4 | |
parent | 32bb236f2433041569218f85052088b85732ef4e (diff) | |
parent | f2d531bd43de60eb48202ad187d06f7187dbf838 (diff) |
Merge pull request #15335 from volzhs/popup-menu
Fix PopupMenu to show & detect properly hover area
-rw-r--r-- | scene/gui/popup_menu.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 7999f50013..97f7c65cbe 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -122,8 +122,7 @@ int PopupMenu::_get_mouse_over(const Point2 &p_over) const { for (int i = 0; i < items.size(); i++) { - if (i > 0) - ofs.y += vseparation; + ofs.y += vseparation; float h; if (!items[i].icon.is_null()) { @@ -459,7 +458,7 @@ void PopupMenu::_notification(int p_what) { if (i == mouse_over) { - hover->draw(ci, Rect2(item_ofs + Point2(-hseparation, -vseparation), Size2(get_size().width - style->get_minimum_size().width + hseparation * 2, h + vseparation * 2))); + hover->draw(ci, Rect2(item_ofs + Point2(-hseparation, -vseparation / 2), Size2(get_size().width - style->get_minimum_size().width + hseparation * 2, h + vseparation))); } if (items[i].separator) { |