summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-07-31 18:35:11 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2014-07-31 18:35:11 +0100
commitae2f608a4a64f29be1e98dc0c66288770b64cadc (patch)
tree1bb3eec94e73392dc2028dbd4471f2c3fbcb3318
parent88b4af2eef0f89b46980cc1bbba77955f445d6b9 (diff)
downloadlibnsfb-ae2f608a4a64f29be1e98dc0c66288770b64cadc.tar.gz
libnsfb-ae2f608a4a64f29be1e98dc0c66288770b64cadc.tar.bz2
Fix rendering of 1bpp glyphs when glyph data is greater than one byte wide
-rw-r--r--src/plot/common.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plot/common.c b/src/plot/common.c
index 063f68d..b051131 100644
--- a/src/plot/common.c
+++ b/src/plot/common.c
@@ -149,7 +149,6 @@ glyph1(nsfb_t *nsfb,
int width;
int height;
const size_t line_len = PLOT_LINELEN(nsfb->linelen);
- const int first_col = 1 << (loc->x1 - loc->x0 - 1);
const uint8_t *row;
if (!nsfb_plot_clip_ctx(nsfb, loc))
@@ -172,7 +171,7 @@ glyph1(nsfb_t *nsfb,
for (; pvideo < pvideo_limit; pvideo += line_len) {
for (xloop = xoff; xloop < width; xloop++) {
- if ((*row & (first_col >> xloop)) != 0) {
+ if (row[xloop / 8] & ((1<<7) >> (xloop % 8))) {
*(pvideo + xloop) = fgcol;
}
}