mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
glyph_bytes() should pad to an even number
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30606 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
291c6be8e4
commit
01b36e889c
1 changed files with 6 additions and 3 deletions
|
@ -172,9 +172,12 @@ static int32_t readlong(struct font *pf)
|
||||||
|
|
||||||
static int glyph_bytes( struct font *pf, int width )
|
static int glyph_bytes( struct font *pf, int width )
|
||||||
{
|
{
|
||||||
return pf->depth ?
|
int ret;
|
||||||
(pf->height * width + 1) / 2:
|
if (pf->depth)
|
||||||
width * ((pf->height + 7) / 8);
|
ret = ( pf->height * width + 1 ) / 2;
|
||||||
|
else
|
||||||
|
ret = width * ((pf->height + 7) / 8);
|
||||||
|
return (ret + 1) & ~1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct font* font_load_header(struct font *pf)
|
static struct font* font_load_header(struct font *pf)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue