Fix regression introduced by eec89a9.

The icon pixel position must be calculated before y is modified.

Change-Id: I16947dd8862683530dd7c5f00cfa7cf8d9636e61
This commit is contained in:
Thomas Martitz 2014-03-03 15:13:11 +01:00
parent 5900bf7315
commit ee28a706d4

View file

@ -190,14 +190,14 @@ static void print_line(struct screen *display,
icon_h = get_icon_height(display->screen_type); icon_h = get_icon_height(display->screen_type);
icon_w = get_icon_width(display->screen_type); icon_w = get_icon_width(display->screen_type);
tempbuf_idx = 0; tempbuf_idx = 0;
/* vertically center string on the line
* x/2 - y/2 rounds up compared to (x-y)/2 if one of x and y is odd */
y += height/2 - display->getcharheight()/2;
/* For the icon use a differnet calculation which to round down instead. /* For the icon use a differnet calculation which to round down instead.
* This tends to align better with the font's baseline for small heights. * This tends to align better with the font's baseline for small heights.
* A proper aligorithm would take the baseline into account but this has * A proper aligorithm would take the baseline into account but this has
* worked sufficiently well for us (fix this if needed) */ * worked sufficiently well for us (fix this if needed) */
icon_y = y + (height - icon_h)/2; icon_y = y + (height - icon_h)/2;
/* vertically center string on the line
* x/2 - y/2 rounds up compared to (x-y)/2 if one of x and y is odd */
y += height/2 - display->getcharheight()/2;
/* parse format string */ /* parse format string */
while (xpos < max_width) while (xpos < max_width)