Fix submenu alignment with parent menu item

This commit is contained in:
Haoyu Qiu 2023-09-09 14:32:21 +08:00
parent fc99492d30
commit e5ad35a95f

View File

@ -204,9 +204,9 @@ void PopupMenu::_activate_submenu(int p_over, bool p_by_keyboard) {
Point2 submenu_pos;
if (control->is_layout_rtl()) {
submenu_pos = this_pos + Point2(-submenu_size.width, items[p_over]._ofs_cache + scroll_offset);
submenu_pos = this_pos + Point2(-submenu_size.width, items[p_over]._ofs_cache + scroll_offset - theme_cache.v_separation / 2);
} else {
submenu_pos = this_pos + Point2(this_rect.size.width, items[p_over]._ofs_cache + scroll_offset);
submenu_pos = this_pos + Point2(this_rect.size.width, items[p_over]._ofs_cache + scroll_offset - theme_cache.v_separation / 2);
}
// Fix pos if going outside parent rect.