From cf5e98c6cde3a792ef6e0934e2cd512a24b5f002 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 18 Jul 2021 18:16:50 -0400 Subject: [PATCH] fbcon: properly place bitmaps --- src/lib/linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/linux.c b/src/lib/linux.c index 2fff62f1e..256cc957e 100644 --- a/src/lib/linux.c +++ b/src/lib/linux.c @@ -92,10 +92,10 @@ int fbcon_draw(const struct ncpile *p, sprixel* s, FILE* out, int y, int x){ const tinfo* ti = &p->nc->tcache; for(int l = 0 ; l < s->pixy ; ++l){ // FIXME pixel size isn't necessarily 4B, line isn't necessarily psize*pixx - size_t offset = ((l + y) * ti->pixx + x) * 4; - size_t lsize = s->pixx * 4; + size_t offset = ((l + y * ti->cellpixy) * ti->pixx + x * ti->cellpixx) * 4; uint8_t* tl = ti->linux_fbuffer + offset; const char* src = s->glyph + (l * s->pixx * 4); + size_t lsize = s->pixx * 4; memcpy(tl, src, lsize); } return 0;