Merge pull request #3837 from lakkatv/master

(XMB) Fix label centering
This commit is contained in:
Twinaphex 2016-10-20 16:32:23 +02:00 committed by GitHub
commit 838cae65c3
1 changed files with 13 additions and 8 deletions

View File

@ -1801,7 +1801,7 @@ static void xmb_draw_items(xmb_handle_t *xmb,
for (; i < end; i++) for (; i < end; i++)
{ {
float icon_x, icon_y; float icon_x, icon_y, label_offset;
menu_animation_ctx_ticker_t ticker; menu_animation_ctx_ticker_t ticker;
char ticker_str[PATH_MAX_LENGTH]; char ticker_str[PATH_MAX_LENGTH];
char name[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); menu_animation_ctl(MENU_ANIMATION_CTL_TICKER, &ticker);
xmb_draw_text(xmb, name, label_offset = xmb->margins.label.top;
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);
if (i == current && menu_entry_get_sublabel(i, entry_sublabel, sizeof(entry_sublabel))) 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, xmb_draw_text(xmb, entry_sublabel,
node->x + xmb->margins.screen.left + node->x + xmb->margins.screen.left +
xmb->icon.spacing.horizontal + xmb->margins.label.left, xmb->icon.spacing.horizontal + xmb->margins.label.left,
xmb->margins.screen.top + node->y + xmb->margins.label.top*3.0, xmb->margins.screen.top + node->y + xmb->margins.label.top*3.0,
1, node->label_alpha, TEXT_ALIGN_LEFT, 1, node->label_alpha, TEXT_ALIGN_LEFT,
width, height, xmb->font2); 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.s = value;
ticker.len = 35; ticker.len = 35;