diff options
author | Teruaki Kawashima <teru@rockbox.org> | 2009-11-22 15:43:57 +0000 |
---|---|---|
committer | Teruaki Kawashima <teru@rockbox.org> | 2009-11-22 15:43:57 +0000 |
commit | 1fe6f13b9c14504548c6436938c368d1204260ef (patch) | |
tree | d643339b812eb005df0bd274d2dcc3e10d058bd5 /firmware/drivers | |
parent | 728f698fa1d02e990f869da23161f376a63adbbd (diff) | |
download | rockbox-1fe6f13b9c14504548c6436938c368d1204260ef.tar.gz rockbox-1fe6f13b9c14504548c6436938c368d1204260ef.zip |
lcd-bitmap-common.c: Change calculation of the horizontal position in lcd_puts_style_offset() so that the position is independent from the string being printed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23705 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/lcd-bitmap-common.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c index 26491e78e8..70ae00ba84 100644 --- a/firmware/drivers/lcd-bitmap-common.c +++ b/firmware/drivers/lcd-bitmap-common.c | |||
@@ -194,14 +194,12 @@ void LCDFN(puts_style_offset)(int x, int y, const unsigned char *str, | |||
194 | int style, int offset) | 194 | int style, int offset) |
195 | { | 195 | { |
196 | int xpos, ypos, w, h; | 196 | int xpos, ypos, w, h; |
197 | unsigned long chars_in_str; | ||
198 | LCDFN(scroll_stop_line)(current_vp, y); | 197 | LCDFN(scroll_stop_line)(current_vp, y); |
199 | if(!str || !str[0]) | 198 | if(!str || !str[0]) |
200 | return; | 199 | return; |
201 | 200 | ||
202 | chars_in_str = utf8length((char *)str); | ||
203 | LCDFN(getstringsize)(str, &w, &h); | 201 | LCDFN(getstringsize)(str, &w, &h); |
204 | xpos = x * w / chars_in_str; | 202 | xpos = x * LCDFN(getstringsize)(" ", NULL, NULL); |
205 | ypos = y * h; | 203 | ypos = y * h; |
206 | LCDFN(putsxyofs_style)(xpos, ypos, str, style, w, h, offset); | 204 | LCDFN(putsxyofs_style)(xpos, ypos, str, style, w, h, offset); |
207 | } | 205 | } |
@@ -289,7 +287,7 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string, | |||
289 | s->y = y; | 287 | s->y = y; |
290 | s->len = utf8length(string); | 288 | s->len = utf8length(string); |
291 | s->offset = offset; | 289 | s->offset = offset; |
292 | s->startx = x * s->width / s->len; | 290 | s->startx = x * LCDFN(getstringsize)(" ", NULL, NULL); |
293 | s->backward = false; | 291 | s->backward = false; |
294 | 292 | ||
295 | LCDFN(scroll_info).lines++; | 293 | LCDFN(scroll_info).lines++; |