diff options
| author | Thomas Martitz <kugel@rockbox.org> | 2013-04-16 16:06:13 +0200 |
|---|---|---|
| committer | Thomas Martitz <kugel@rockbox.org> | 2014-01-07 14:13:48 +0100 |
| commit | 49780944809651f28e8135bf6d67dcd8ceeb2585 (patch) | |
| tree | 4893467ebcf509eeab6990905511f40c852b7f03 /firmware/drivers | |
| parent | 9a4686b563ac9e27615e1032792bd9878bb291f7 (diff) | |
| download | rockbox-49780944809651f28e8135bf6d67dcd8ceeb2585.zip rockbox-49780944809651f28e8135bf6d67dcd8ceeb2585.tar.gz rockbox-49780944809651f28e8135bf6d67dcd8ceeb2585.tar.bz2 rockbox-49780944809651f28e8135bf6d67dcd8ceeb2585.tar.xz | |
lcd-common: Remove support for custom line heights from viewport.
Since scrolling is now pixel-based this is not necessary anymore. custom line
height is handled by put_line() but can also possible to implement with
lcd_puts_scroll_func().
Change-Id: Iee9b12bf99afac93d95d2a1a6f5d5b4db237b21c
Diffstat (limited to 'firmware/drivers')
| -rw-r--r-- | firmware/drivers/lcd-bitmap-common.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c index 330639f..97921c6 100644 --- a/firmware/drivers/lcd-bitmap-common.c +++ b/firmware/drivers/lcd-bitmap-common.c @@ -387,12 +387,11 @@ void LCDFN(putsxyf)(int x, int y, const unsigned char *fmt, ...) static void LCDFN(putsxyofs_style)(int xpos, int ypos, const unsigned char *str, int style, - int h, int offset) + int offset) { int lastmode = current_vp->drawmode; int text_ypos = ypos; - int line_height = font_get(current_vp->font)->height; - text_ypos += h/2 - line_height/2; /* center the text in the line */ + int h = font_get(current_vp->font)->height; if ((style & STYLE_MODE_MASK) == STYLE_NONE) { if (str[0]) @@ -452,7 +451,7 @@ static void LCDFN(putsofs_style)(int x, int y, const unsigned char *str, if(!str) return; - h = current_vp->line_height ?: (int)font_get(current_vp->font)->height; + h = font_get(current_vp->font)->height; if ((style&STYLE_XY_PIXELS) == 0) { xpos = x * LCDFN(getstringsize)(" ", NULL, NULL); @@ -464,7 +463,7 @@ static void LCDFN(putsofs_style)(int x, int y, const unsigned char *str, ypos = y; } LCDFN(scroll_stop_viewport_rect)(current_vp, xpos, ypos, current_vp->width - xpos, h); - LCDFN(putsxyofs_style)(xpos, ypos+y_offset, str, style, h, x_offset); + LCDFN(putsxyofs_style)(xpos, ypos+y_offset, str, style, x_offset); } void LCDFN(puts)(int x, int y, const unsigned char *str) @@ -501,7 +500,7 @@ static struct scrollinfo* find_scrolling_line(int x, int y) void LCDFN(scroll_fn)(struct scrollinfo* s) { - LCDFN(putsxyofs_style)(s->x, s->y, s->line, s->style, s->height, s->offset); + LCDFN(putsxyofs_style)(s->x, s->y, s->line, s->style, s->offset); } static void LCDFN(puts_scroll_worker)(int x, int y, const unsigned char *string, @@ -521,7 +520,7 @@ static void LCDFN(puts_scroll_worker)(int x, int y, const unsigned char *string, /* prepare rectangle for scrolling. x and y must be calculated early * for find_scrolling_line() to work */ cwidth = font_get(current_vp->font)->maxwidth; - height = current_vp->line_height ?: (int)font_get(current_vp->font)->height; + height = font_get(current_vp->font)->height; y = y * (linebased ? height : 1) + y_offset; x = x * (linebased ? cwidth : 1); width = current_vp->width - x; @@ -535,7 +534,7 @@ static void LCDFN(puts_scroll_worker)(int x, int y, const unsigned char *string, if (restart) { /* remove any previously scrolling line at the same location */ LCDFN(scroll_stop_viewport_rect)(current_vp, x, y, width, height); - LCDFN(putsxyofs_style)(x, y, string, style, height, x_offset); + LCDFN(putsxyofs_style)(x, y, string, style, x_offset); if (LCDFN(scroll_info).lines >= LCDM(SCROLLABLE_LINES)) return; |