diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2011-12-14 09:48:52 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2011-12-14 09:48:52 +0000 |
| commit | b3caa010624248930eaf487b5e151bbe2b9b9f27 (patch) | |
| tree | 4c1c688831ddcc77afd4c8c28d5cb5e850f9d979 /firmware | |
| parent | bfd69f2aa19321e7fb3dfdd0befcfc7e32eca656 (diff) | |
| download | rockbox-b3caa010624248930eaf487b5e151bbe2b9b9f27.zip rockbox-b3caa010624248930eaf487b5e151bbe2b9b9f27.tar.gz rockbox-b3caa010624248930eaf487b5e151bbe2b9b9f27.tar.bz2 rockbox-b3caa010624248930eaf487b5e151bbe2b9b9f27.tar.xz | |
Fix FS#12237 (caused by r30302) where centered skin text isnt eqactly centered
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31246 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
| -rw-r--r-- | firmware/drivers/lcd-bitmap-common.c | 12 | ||||
| -rw-r--r-- | firmware/export/lcd.h | 5 |
2 files changed, 15 insertions, 2 deletions
diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c index 76c4260..3806bb0 100644 --- a/firmware/drivers/lcd-bitmap-common.c +++ b/firmware/drivers/lcd-bitmap-common.c @@ -318,8 +318,16 @@ void LCDFN(puts_style_xyoffset)(int x, int y, const unsigned char *str, return; h = current_vp->line_height ?: (int)font_get(current_vp->font)->height; - xpos = x * LCDFN(getstringsize)(" ", NULL, NULL); - ypos = y * h + y_offset; + if ((style&STYLE_XY_PIXELS) == 0) + { + xpos = x * LCDFN(getstringsize)(" ", NULL, NULL); + ypos = y * h + y_offset; + } + else + { + xpos = x; + ypos = y + y_offset; + } LCDFN(putsxyofs_style)(xpos, ypos, str, style, h, x_offset); } diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 76b8b09..2d0123c 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h @@ -125,6 +125,11 @@ enum screen_type { #define STYLE_COLORBAR 0x40000000 #define STYLE_GRADIENT 0x80000000 #define STYLE_MODE_MASK 0xF0000000 +/* HACK: This isnt really a style, We need to be able to tell some of + * the lcd API that we want to draw text to a specific pixel instead + * of a char. Remove this hack when the whole LCD api goes to fully + * pixel based positioning - jdgordon */ +#define STYLE_XY_PIXELS 0x00010000 #define STYLE_COLOR_MASK 0x0000FFFF #ifdef HAVE_LCD_COLOR #define STYLE_CURLN_MASK 0x0000FF00 |