Skip to content

Commit 097c675

Browse files
committed
Fix incorrect submenu icon and accelerator text positions involving margins
1 parent 4b7776e commit 097c675

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
@@ -861,9 +861,9 @@ void PopupMenu::_draw_items() {
861861
// Submenu arrow on right hand side.
862862
if (items[i].submenu) {
863863
if (rtl) {
864-
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);
864+
submenu->draw(ci, Point2(theme_cache.item_end_padding, item_ofs.y + Math::floor(h - submenu->get_height()) / 2), icon_color);
865865
} else {
866-
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);
866+
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);
867867
}
868868
}
869869

@@ -898,9 +898,9 @@ void PopupMenu::_draw_items() {
898898
// Accelerator / Shortcut
899899
if (items[i].accel != Key::NONE || (items[i].shortcut.is_valid() && items[i].shortcut->has_valid_event())) {
900900
if (rtl) {
901-
item_ofs.x = theme_cache.panel_style->get_margin(SIDE_LEFT) + theme_cache.item_end_padding;
901+
item_ofs.x = theme_cache.item_end_padding;
902902
} else {
903-
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;
903+
item_ofs.x = display_width - items[i].accel_text_buf->get_size().x - theme_cache.item_end_padding;
904904
}
905905
Vector2 text_pos = item_ofs + Point2(0, Math::floor((h - items[i].text_buf->get_size().y) / 2.0));
906906
if (theme_cache.font_outline_size > 0 && theme_cache.font_outline_color.a > 0) {

0 commit comments

Comments
 (0)