summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_render.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/skin_render.c')
-rw-r--r--apps/gui/skin_engine/skin_render.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/apps/gui/skin_engine/skin_render.c b/apps/gui/skin_engine/skin_render.c
index 67542adc6b..1f777b6672 100644
--- a/apps/gui/skin_engine/skin_render.c
+++ b/apps/gui/skin_engine/skin_render.c
@@ -470,42 +470,40 @@ static void fix_line_alignment(struct skin_draw_info *info, struct skin_element
470{ 470{
471 struct align_pos *align = &info->align; 471 struct align_pos *align = &info->align;
472 char *cur_pos = info->cur_align_start + strlen(info->cur_align_start); 472 char *cur_pos = info->cur_align_start + strlen(info->cur_align_start);
473 char *next_pos = cur_pos + 1;
473 switch (element->tag->type) 474 switch (element->tag->type)
474 { 475 {
475 case SKIN_TOKEN_ALIGN_LEFT: 476 case SKIN_TOKEN_ALIGN_LEFT:
476 *cur_pos = '\0'; cur_pos++; *cur_pos = '\0'; 477 align->left = next_pos;
477 align->left = cur_pos; 478 info->cur_align_start = next_pos;
478 info->cur_align_start = cur_pos;
479 break; 479 break;
480 case SKIN_TOKEN_ALIGN_LEFT_RTL: 480 case SKIN_TOKEN_ALIGN_LEFT_RTL:
481 *cur_pos = '\0'; cur_pos++; *cur_pos = '\0'; 481 if (UNLIKELY(lang_is_rtl()))
482 if (lang_is_rtl()) 482 align->right = next_pos;
483 align->right = cur_pos;
484 else 483 else
485 align->left = cur_pos; 484 align->left = next_pos;
486 info->cur_align_start = cur_pos; 485 info->cur_align_start = next_pos;
487 break; 486 break;
488 case SKIN_TOKEN_ALIGN_CENTER: 487 case SKIN_TOKEN_ALIGN_CENTER:
489 *cur_pos = '\0'; cur_pos++; *cur_pos = '\0'; 488 align->center = next_pos;
490 align->center = cur_pos; 489 info->cur_align_start = next_pos;
491 info->cur_align_start = cur_pos;
492 break; 490 break;
493 case SKIN_TOKEN_ALIGN_RIGHT: 491 case SKIN_TOKEN_ALIGN_RIGHT:
494 *cur_pos = '\0'; cur_pos++; *cur_pos = '\0'; 492 align->right = next_pos;
495 align->right = cur_pos; 493 info->cur_align_start = next_pos;
496 info->cur_align_start = cur_pos;
497 break; 494 break;
498 case SKIN_TOKEN_ALIGN_RIGHT_RTL: 495 case SKIN_TOKEN_ALIGN_RIGHT_RTL:
499 *cur_pos = '\0'; cur_pos++; *cur_pos = '\0'; 496 if (UNLIKELY(lang_is_rtl()))
500 if (lang_is_rtl()) 497 align->left = next_pos;
501 align->left = cur_pos;
502 else 498 else
503 align->right = cur_pos; 499 align->right = next_pos;
504 info->cur_align_start = cur_pos; 500 info->cur_align_start = next_pos;
505 break; 501 break;
506 default: 502 default:
507 break; 503 return;
508 } 504 }
505 *cur_pos = '\0';
506 *next_pos = '\0';
509} 507}
510 508
511/* Draw a LINE element onto the display */ 509/* Draw a LINE element onto the display */