From 17e92a69f98c6f1b18716ce56705696f6e0a97d9 Mon Sep 17 00:00:00 2001 From: nick black Date: Mon, 8 Mar 2021 05:02:15 -0500 Subject: [PATCH] keller: work around damage check for pixel #1381 --- src/demo/keller.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/demo/keller.c b/src/demo/keller.c index 2501040b5..6441b649d 100644 --- a/src/demo/keller.c +++ b/src/demo/keller.c @@ -15,7 +15,7 @@ visualize(struct notcurses* nc, struct ncvisual* ncv){ }; for(size_t i = 0 ; i < sizeof(bs) / sizeof(*bs) ; ++i){ struct ncvisual_options vopts = { - .scaling = bs[i] == NCBLIT_PIXEL ? NCSCALE_SCALE : NCSCALE_STRETCH, + .scaling = bs[i] == NCBLIT_PIXEL ? NCSCALE_NONE : NCSCALE_STRETCH, .blitter = bs[i], .n = notcurses_stdplane(nc), .y = 1, @@ -26,10 +26,18 @@ visualize(struct notcurses* nc, struct ncvisual* ncv){ vopts.x = (ncplane_dim_x(notcurses_stdplane(nc)) - truex / scalex) / 2; ncplane_set_fg_rgb(vopts.n, 0xffffff); ncplane_set_bg_rgb(vopts.n, 0); + ncplane_erase(vopts.n); + // if we're about to blit pixel graphics, render the screen as empty, so + // that everything is damaged for the printing of the legend. + if(vopts.blitter == NCBLIT_PIXEL){ + DEMO_RENDER(nc); + } if(ncvisual_render(nc, ncv, &vopts) == NULL){ - ncplane_erase(vopts.n); ncplane_printf_aligned(vopts.n, ncplane_dim_y(vopts.n) / 2 - 1, NCALIGN_CENTER, "not available"); }else{ + if(vopts.blitter == NCBLIT_PIXEL){ + DEMO_RENDER(nc); + } ncplane_printf_aligned(vopts.n, ncplane_dim_y(vopts.n) / 2 - 1, NCALIGN_CENTER, "%03dx%03d", truex, truey); ncplane_printf_aligned(vopts.n, ncplane_dim_y(vopts.n) / 2 + 1, NCALIGN_CENTER,