From 532b8141ab24f386e35f389277b4f3bc67211ed5 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Fri, 18 Apr 2014 13:27:25 +0200 Subject: skin_engine: Make %Vs affect the whole line. Previously %Vs styles only took effect upon the first character of text, i.e. on the right if the line is %arXXX. Now the style is applied for the whole line width. Fixes FS#12973. Change-Id: I95f2cc76a90bfc0779e5a667d5bfa54c33896c89 --- apps/gui/skin_engine/skin_display.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 60557bba0d..501d3a305a 100755 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c @@ -604,15 +604,15 @@ void write_line(struct screen *display, struct align_pos *format_align, center_xpos = (viewport_width-center_width)/2; right_xpos = viewport_width-right_width; #endif - /* print aligned strings */ - if (left_width != 0) - display->put_line(0, line, linedes, "$t", format_align->left); - - if (center_width != 0) - display->put_line(center_xpos, line, linedes, "$t", format_align->center); - - if (right_width != 0) - display->put_line(right_xpos, line, linedes, "$t", format_align->right); + /* print aligned strings. print whole line at once so that %Vs works + * across the full viewport width */ + char *left = format_align->left ?: ""; + char *center = format_align->center ?: ""; + char *right = format_align->right ?: ""; + + display->put_line(0, line, linedes, "$t$*s$t$*s$t", left, + center_xpos - left_width, center, + right_xpos - (center_xpos + center_width), right); } } -- cgit v1.2.3