Fix hover being drawn twice inside PopupMenus

This commit is contained in:
Michael Alexsander 2022-06-04 02:51:22 -03:00 committed by Relintai
parent a8a140af27
commit 2ebc4905fc
2 changed files with 4 additions and 4 deletions

View File

@ -571,7 +571,6 @@ void PopupMenu::_notification(int p_what) {
}
if (i == mouse_over) {
hover->draw(ci, Rect2(item_ofs + Point2(-hseparation, -vseparation / 2), Size2(get_size().width - style->get_minimum_size().width + hseparation * 2, h + vseparation)));
hover->draw(ci, Rect2(item_ofs + Point2(0, -vseparation / 2), Size2(size.width - style->get_minimum_size().width, h + vseparation)));
}

View File

@ -569,9 +569,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
Ref<StyleBoxTexture> style_pp = sb_expand(make_stylebox(popup_bg_png, 5, 5, 5, 5, 4, 4, 4, 4), 2, 2, 2, 2);
Ref<StyleBoxTexture> selected = make_stylebox(selection_png, 6, 6, 6, 6);
for (int i = 0; i < 4; i++) {
selected->set_expand_margin_size(Margin(i), 2 * scale);
}
selected->set_expand_margin_size(MARGIN_TOP, 2 * scale);
selected->set_expand_margin_size(MARGIN_BOTTOM, 2 * scale);
selected->set_expand_margin_size(MARGIN_LEFT, 6 * scale);
selected->set_expand_margin_size(MARGIN_RIGHT, 6 * scale);
theme->set_stylebox("panel", "PopupPanel", style_pp);