From ae2f608a4a64f29be1e98dc0c66288770b64cadc Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 31 Jul 2014 18:35:11 +0100 Subject: Fix rendering of 1bpp glyphs when glyph data is greater than one byte wide --- src/plot/common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') 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; } } -- cgit v1.2.3