From b1c0ce6a6894e957d13a61d169828327e36da47f Mon Sep 17 00:00:00 2001 From: nick black Date: Tue, 1 Jun 2021 01:12:42 -0400 Subject: [PATCH] ncplane_from_rgba: correct scaling for 3x2/2x2/braille #1490 --- src/lib/notcurses.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 2f2988c770..7dc5ad7bfb 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -2710,9 +2710,9 @@ fprintf(stderr, "%d/%d (%d/%d): [%s] %d %d %d %d\n", y, x, leny, lenx, c, idx, f // handle each destination pixel from this cell for(int py = 0 ; py < bset->height ; ++py){ for(int px = 0 ; px < bset->width ; ++px){ - uint32_t* p = &ret[(targy + py) * lenx + (targx + px)]; + uint32_t* p = &ret[(targy + py) * (lenx * bset->width) + (targx + px)]; bool background = is_bg_p(idx, py, px, bset->width); -fprintf(stderr, "py/px: %d/%d is_bg_p: %u\n", py, px, background); +fprintf(stderr, "py/px: %d/%d is_bg_p: %u p: %d\n", py, px, background, (targy + py) * (lenx * bset->width) + (targx + px)); if(background){ if(ba){ *p = 0;