summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorFelix Arends <edx@rockbox.org>2002-06-21 13:06:28 +0000
committerFelix Arends <edx@rockbox.org>2002-06-21 13:06:28 +0000
commit7ce440a166751cfda5bcf6ae16aa04fb8e2d5dc6 (patch)
tree37140b8334d5a0776c7fecde28b14e1f7600f65d /firmware/drivers
parentd3f373f7cb538eaf9b4f24cb0bf0aa3a6797fc54 (diff)
fixed the horizontal scroll graphics error
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1132 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/lcd.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/firmware/drivers/lcd.c b/firmware/drivers/lcd.c
index 249253487d..e2cc454e14 100644
--- a/firmware/drivers/lcd.c
+++ b/firmware/drivers/lcd.c
@@ -914,12 +914,20 @@ void lcd_getfontsize(unsigned int font, int *width, int *height)
void lcd_puts_scroll(int x, int y, char* string )
{
struct scrollinfo* s = &scroll;
+ char *ch;
#ifdef HAVE_LCD_CHARCELLS
s->space = 11 - x;
#else
int width, height;
lcd_getfontsize(font, &width, &height);
+#ifndef LCD_PROPFONTS
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
lcd_puts(x,y,string);
s->textlen = strlen(string);
@@ -941,6 +949,12 @@ void lcd_stop_scroll(void)
struct scrollinfo* s = &scroll;
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 */
lcd_puts(s->startx,s->starty,s->text);
lcd_update();