diff options
author | Thomas Martitz <kugel@rockbox.org> | 2014-02-28 07:29:32 +0100 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2014-03-03 11:20:13 +0100 |
commit | 3ae07d48a2182fc3b1f8e9b15e6366ff32b92e25 (patch) | |
tree | 1683e5d6714b4a2b3bf501096b7a60953318360e /apps/gui/line.c | |
parent | 05999ed86d55ca51a9371b0253cdabd734539d1f (diff) | |
download | rockbox-3ae07d48a2182fc3b1f8e9b15e6366ff32b92e25.tar.gz rockbox-3ae07d48a2182fc3b1f8e9b15e6366ff32b92e25.zip |
Fix FS#12951: The icons could be a pixel to far down.
Since eec89a9 icons have been centered using same calculation as for fonts.
In edge cases this is visually different from before and didn't align
well to the font's baseline. Revert to the old calculation just for centering
icons to fix.
A proper aligorithm would take the baseline into account but this has
worked sufficiently well for us (fix this if needed)
Change-Id: I86593529b16cd28ae4552641e216e73795f2450c
Diffstat (limited to 'apps/gui/line.c')
-rw-r--r-- | apps/gui/line.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/gui/line.c b/apps/gui/line.c index 4d08a34372..449d01a896 100644 --- a/apps/gui/line.c +++ b/apps/gui/line.c | |||
@@ -192,8 +192,12 @@ static void print_line(struct screen *display, | |||
192 | tempbuf_idx = 0; | 192 | tempbuf_idx = 0; |
193 | /* vertically center string on the line | 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 */ | 194 | * x/2 - y/2 rounds up compared to (x-y)/2 if one of x and y is odd */ |
195 | icon_y = y + height/2 - icon_h/2; | ||
196 | y += height/2 - display->getcharheight()/2; | 195 | y += height/2 - display->getcharheight()/2; |
196 | /* 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. | ||
198 | * A proper aligorithm would take the baseline into account but this has | ||
199 | * worked sufficiently well for us (fix this if needed) */ | ||
200 | icon_y = y + (height - icon_h)/2; | ||
197 | 201 | ||
198 | /* parse format string */ | 202 | /* parse format string */ |
199 | while (xpos < max_width) | 203 | while (xpos < max_width) |