diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-05-16 19:37:21 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-05-16 19:37:21 +0000 |
commit | 3206e11964d09a3855912646608f27bd5c3fb3d2 (patch) | |
tree | db6e52c1474d305452c3f60dd341238bf33c336e | |
parent | b9aa66266d4afd4ff8fe978bca4d706a809a4c1c (diff) | |
download | px4-nuttx-3206e11964d09a3855912646608f27bd5c3fb3d2.tar.gz px4-nuttx-3206e11964d09a3855912646608f27bd5c3fb3d2.tar.bz2 px4-nuttx-3206e11964d09a3855912646608f27bd5c3fb3d2.zip |
Fix case where stride != width
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2683 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/graphics/nxfonts/nxfonts_convert.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/nuttx/graphics/nxfonts/nxfonts_convert.c b/nuttx/graphics/nxfonts/nxfonts_convert.c index 0f8788b8f..27549fa0c 100644 --- a/nuttx/graphics/nxfonts/nxfonts_convert.c +++ b/nuttx/graphics/nxfonts/nxfonts_convert.c @@ -185,7 +185,7 @@ int NXF_FUNCNAME(nxf_convert,NXFONTS_SUFFIX) for (row = 0; row < height; row++) { - /* Process each byte in the glyph */ + /* Process each byte in the glyph row */ col = 0; dptr = (FAR NXF_PIXEL_T*)line; @@ -197,7 +197,7 @@ int NXF_FUNCNAME(nxf_convert,NXFONTS_SUFFIX) { bmbyte = *sptr++; - /* Process each bit in the byte */ + /* Process each bit in one byte */ for (bmbit = 7; bmbit >= 0 && col < width; bmbit--, col++) { @@ -224,15 +224,20 @@ int NXF_FUNCNAME(nxf_convert,NXFONTS_SUFFIX) nbits = 0; } } + } - /* Handle any fractional bytes at the end */ + /* The entire glyph row has been rendered. Handle any fractional bytes at + * the end of the row + */ - if (nbits > 0) - { - *dptr = pixel; - } - line += stride; + if (nbits > 0) + { + *dptr = pixel; } + + /* Point to the beginning of the next row */ + + line += stride; } #else /* Handle each row in both the input and output */ |