mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 07:53:26 +00:00
Merge pull request #90832 from YeldhamDev/just_ignore_the_margin_bro
Fix incorrect submenu icon and accelerator text positions involving margins
This commit is contained in:
commit
8ccb7ba2ec
1 changed files with 4 additions and 4 deletions
|
@ -924,9 +924,9 @@ void PopupMenu::_draw_items() {
|
|||
// Submenu arrow on right hand side.
|
||||
if (items[i].submenu) {
|
||||
if (rtl) {
|
||||
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);
|
||||
submenu->draw(ci, Point2(theme_cache.item_end_padding, item_ofs.y + Math::floor(h - submenu->get_height()) / 2), icon_color);
|
||||
} else {
|
||||
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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -961,9 +961,9 @@ void PopupMenu::_draw_items() {
|
|||
// Accelerator / Shortcut
|
||||
if (items[i].accel != Key::NONE || (items[i].shortcut.is_valid() && items[i].shortcut->has_valid_event())) {
|
||||
if (rtl) {
|
||||
item_ofs.x = theme_cache.panel_style->get_margin(SIDE_LEFT) + theme_cache.item_end_padding;
|
||||
item_ofs.x = theme_cache.item_end_padding;
|
||||
} else {
|
||||
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;
|
||||
item_ofs.x = display_width - items[i].accel_text_buf->get_size().x - theme_cache.item_end_padding;
|
||||
}
|
||||
Vector2 text_pos = item_ofs + Point2(0, Math::floor((h - items[i].accel_text_buf->get_size().y) / 2.0));
|
||||
if (theme_cache.font_outline_size > 0 && theme_cache.font_outline_color.a > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue