summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2014-03-03 15:13:11 +0100
committerThomas Martitz <kugel@rockbox.org>2014-03-03 15:14:07 +0100
commitee28a706d4909b00d6bcfc304683b10ba9b853e0 (patch)
tree9c47169d3f52201aeaf4acad551ac75f3ba701c3
parent5900bf731518799d5a9bfb598a44d7a21155fa54 (diff)
downloadrockbox-ee28a706d4909b00d6bcfc304683b10ba9b853e0.tar.gz
rockbox-ee28a706d4909b00d6bcfc304683b10ba9b853e0.zip
Fix regression introduced by eec89a9.
The icon pixel position must be calculated before y is modified. Change-Id: I16947dd8862683530dd7c5f00cfa7cf8d9636e61
-rw-r--r--apps/gui/line.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/gui/line.c b/apps/gui/line.c
index 449d01a896..55100f715c 100644
--- a/apps/gui/line.c
+++ b/apps/gui/line.c
@@ -190,14 +190,14 @@ static void print_line(struct screen *display,
190 icon_h = get_icon_height(display->screen_type); 190 icon_h = get_icon_height(display->screen_type);
191 icon_w = get_icon_width(display->screen_type); 191 icon_w = get_icon_width(display->screen_type);
192 tempbuf_idx = 0; 192 tempbuf_idx = 0;
193 /* vertically center string on the line
194 * x/2 - y/2 rounds up compared to (x-y)/2 if one of x and y is odd */
195 y += height/2 - display->getcharheight()/2;
196 /* For the icon use a differnet calculation which to round down instead. 193 /* For the icon use a differnet calculation which to round down instead.
197 * This tends to align better with the font's baseline for small heights. 194 * This tends to align better with the font's baseline for small heights.
198 * A proper aligorithm would take the baseline into account but this has 195 * A proper aligorithm would take the baseline into account but this has
199 * worked sufficiently well for us (fix this if needed) */ 196 * worked sufficiently well for us (fix this if needed) */
200 icon_y = y + (height - icon_h)/2; 197 icon_y = y + (height - icon_h)/2;
198 /* vertically center string on the line
199 * x/2 - y/2 rounds up compared to (x-y)/2 if one of x and y is odd */
200 y += height/2 - display->getcharheight()/2;
201 201
202 /* parse format string */ 202 /* parse format string */
203 while (xpos < max_width) 203 while (xpos < max_width)