Skip to content

Commit 8ccb7ba

Browse files
committed
Merge pull request #90832 from YeldhamDev/just_ignore_the_margin_bro
Fix incorrect submenu icon and accelerator text positions involving margins
2 parents bfe246c + 097c675 commit 8ccb7ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scene/gui/popup_menu.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -924,9 +924,9 @@ void PopupMenu::_draw_items() {
924924
// Submenu arrow on right hand side.
925925
if (items[i].submenu) {
926926
if (rtl) {
927-
submenu->draw(ci, Point2(theme_cache.panel_style->get_margin(SIDE_LEFT) + theme_cache.item_end_padding, item_ofs.y + Math::floor(h - submenu->get_height()) / 2), icon_color);
927+
submenu->draw(ci, Point2(theme_cache.item_end_padding, item_ofs.y + Math::floor(h - submenu->get_height()) / 2), icon_color);
928928
} else {
929-
submenu->draw(ci, Point2(display_width - theme_cache.panel_style->get_margin(SIDE_RIGHT) - submenu->get_width() - theme_cache.item_end_padding, item_ofs.y + Math::floor(h - submenu->get_height()) / 2), icon_color);
929+
submenu->draw(ci, Point2(display_width - submenu->get_width() - theme_cache.item_end_padding, item_ofs.y + Math::floor(h - submenu->get_height()) / 2), icon_color);
930930
}
931931
}
932932

@@ -961,9 +961,9 @@ void PopupMenu::_draw_items() {
961961
// Accelerator / Shortcut
962962
if (items[i].accel != Key::NONE || (items[i].shortcut.is_valid() && items[i].shortcut->has_valid_event())) {
963963
if (rtl) {
964-
item_ofs.x = theme_cache.panel_style->get_margin(SIDE_LEFT) + theme_cache.item_end_padding;
964+
item_ofs.x = theme_cache.item_end_padding;
965965
} else {
966-
item_ofs.x = display_width - theme_cache.panel_style->get_margin(SIDE_RIGHT) - items[i].accel_text_buf->get_size().x - theme_cache.item_end_padding;
966+
item_ofs.x = display_width - items[i].accel_text_buf->get_size().x - theme_cache.item_end_padding;
967967
}
968968
Vector2 text_pos = item_ofs + Point2(0, Math::floor((h - items[i].accel_text_buf->get_size().y) / 2.0));
969969
if (theme_cache.font_outline_size > 0 && theme_cache.font_outline_color.a > 0) {

0 commit comments

Comments
 (0)