1
0
Fork 0
forked from len0rd/rockbox

Propfont fix/kludge for the scroll code. Now doesn't garble the line and should start scrolling the lines that need it.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1981 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2002-08-26 10:30:11 +00:00
parent 446828b2fb
commit b5aceb8d2b

View file

@ -1282,13 +1282,24 @@ void lcd_puts_scroll(int x, int y, unsigned char* string )
lcd_puts(x,y,string);
s->textlen = strlen(string);
#if defined(LCD_PROPFONTS) || defined(LOADABLE_FONTS)
s->space += 2;
lcd_getstringsize(string,0,&w,&h);
if ( w > LCD_WIDTH - xmargin ) {
#else
if ( s->textlen > s->space ) {
#endif
s->offset=s->space;
s->startx=x;
s->starty=y;
strncpy(s->text,string,sizeof s->text);
s->text[sizeof s->text - 1] = 0;
strncpy(s->line,string,sizeof s->line);
memset(s->line, 0, sizeof s->line);
strncpy(s->line,string,
s->space > (int)sizeof s->line ?
(int)sizeof s->line : s->space );
s->line[sizeof s->line - 1] = 0;
scroll_count = 1;
}