From 1fe6f13b9c14504548c6436938c368d1204260ef Mon Sep 17 00:00:00 2001 From: Teruaki Kawashima Date: Sun, 22 Nov 2009 15:43:57 +0000 Subject: 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 --- firmware/drivers/lcd-bitmap-common.c | 6 ++---- 1 file 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, int style, int offset) { int xpos, ypos, w, h; - unsigned long chars_in_str; LCDFN(scroll_stop_line)(current_vp, y); if(!str || !str[0]) return; - chars_in_str = utf8length((char *)str); LCDFN(getstringsize)(str, &w, &h); - xpos = x * w / chars_in_str; + xpos = x * LCDFN(getstringsize)(" ", NULL, NULL); ypos = y * h; LCDFN(putsxyofs_style)(xpos, ypos, str, style, w, h, offset); } @@ -289,7 +287,7 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string, s->y = y; s->len = utf8length(string); s->offset = offset; - s->startx = x * s->width / s->len; + s->startx = x * LCDFN(getstringsize)(" ", NULL, NULL); s->backward = false; LCDFN(scroll_info).lines++; -- cgit v1.2.3