From d027a558c010062297b8b1b44bec6d02a2f00225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Thu, 20 Oct 2016 16:29:14 +0200 Subject: [PATCH] (XMB) Fix label centering --- menu/drivers/xmb.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 8aab222731..8d439836b6 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1801,7 +1801,7 @@ static void xmb_draw_items(xmb_handle_t *xmb, for (; i < end; i++) { - float icon_x, icon_y; + float icon_x, icon_y, label_offset; menu_animation_ctx_ticker_t ticker; char ticker_str[PATH_MAX_LENGTH]; char name[PATH_MAX_LENGTH]; @@ -1922,20 +1922,25 @@ static void xmb_draw_items(xmb_handle_t *xmb, menu_animation_ctl(MENU_ANIMATION_CTL_TICKER, &ticker); - xmb_draw_text(xmb, name, - node->x + xmb->margins.screen.left + - xmb->icon.spacing.horizontal + xmb->margins.label.left, - xmb->margins.screen.top + node->y - xmb->margins.label.top, - 1, node->label_alpha, TEXT_ALIGN_LEFT, - width, height, xmb->font); - + label_offset = xmb->margins.label.top; if (i == current && menu_entry_get_sublabel(i, entry_sublabel, sizeof(entry_sublabel))) + { + label_offset = - xmb->margins.label.top; + xmb_draw_text(xmb, entry_sublabel, node->x + xmb->margins.screen.left + xmb->icon.spacing.horizontal + xmb->margins.label.left, xmb->margins.screen.top + node->y + xmb->margins.label.top*3.0, 1, node->label_alpha, TEXT_ALIGN_LEFT, width, height, xmb->font2); + } + + xmb_draw_text(xmb, name, + node->x + xmb->margins.screen.left + + xmb->icon.spacing.horizontal + xmb->margins.label.left, + xmb->margins.screen.top + node->y + label_offset, + 1, node->label_alpha, TEXT_ALIGN_LEFT, + width, height, xmb->font); ticker.s = value; ticker.len = 35;