forked from len0rd/rockbox
fixed the horizontal scroll graphics error
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1132 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d3f373f7cb
commit
7ce440a166
1 changed files with 14 additions and 0 deletions
|
|
@ -914,12 +914,20 @@ void lcd_getfontsize(unsigned int font, int *width, int *height)
|
||||||
void lcd_puts_scroll(int x, int y, char* string )
|
void lcd_puts_scroll(int x, int y, char* string )
|
||||||
{
|
{
|
||||||
struct scrollinfo* s = &scroll;
|
struct scrollinfo* s = &scroll;
|
||||||
|
char *ch;
|
||||||
#ifdef HAVE_LCD_CHARCELLS
|
#ifdef HAVE_LCD_CHARCELLS
|
||||||
s->space = 11 - x;
|
s->space = 11 - x;
|
||||||
#else
|
#else
|
||||||
int width, height;
|
int width, height;
|
||||||
lcd_getfontsize(font, &width, &height);
|
lcd_getfontsize(font, &width, &height);
|
||||||
|
#ifndef LCD_PROPFONTS
|
||||||
s->space = (LCD_WIDTH - xmargin - x*width) / width;
|
s->space = (LCD_WIDTH - xmargin - x*width) / width;
|
||||||
|
#else
|
||||||
|
ch = string;
|
||||||
|
width = 0;
|
||||||
|
for (s->space = 0; width + (char_dw_8x8_prop[*ch][8]>>4) < LCD_WIDTH - x;
|
||||||
|
width += (char_dw_8x8_prop[*ch][8]>>4), ch++, s->space++);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
lcd_puts(x,y,string);
|
lcd_puts(x,y,string);
|
||||||
s->textlen = strlen(string);
|
s->textlen = strlen(string);
|
||||||
|
|
@ -941,6 +949,12 @@ void lcd_stop_scroll(void)
|
||||||
struct scrollinfo* s = &scroll;
|
struct scrollinfo* s = &scroll;
|
||||||
scroll_count = 0;
|
scroll_count = 0;
|
||||||
|
|
||||||
|
#ifdef LCD_PROPFONTS
|
||||||
|
lcd_clearrect(xmargin + s->startx*fonts[font],
|
||||||
|
ymargin + s->starty*fontheight[font],
|
||||||
|
LCD_WIDTH - xmargin,
|
||||||
|
fontheight[font]);
|
||||||
|
#endif
|
||||||
/* restore scrolled row */
|
/* restore scrolled row */
|
||||||
lcd_puts(s->startx,s->starty,s->text);
|
lcd_puts(s->startx,s->starty,s->text);
|
||||||
lcd_update();
|
lcd_update();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue