mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
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
This commit is contained in:
parent
728f698fa1
commit
1fe6f13b9c
1 changed files with 2 additions and 4 deletions
|
@ -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++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue