From 15d6cfaf35a476e08cbe6def6bf941e4f243f38e Mon Sep 17 00:00:00 2001 From: nick black Date: Wed, 30 Jun 2021 17:31:57 -0400 Subject: [PATCH] allow pixels to stdplane with NCVISUAL_OPTION_CHILDPLANE #1854 --- src/lib/visual.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lib/visual.c b/src/lib/visual.c index 11281e550..2b6722661 100644 --- a/src/lib/visual.c +++ b/src/lib/visual.c @@ -193,8 +193,10 @@ int ncvisual_blitset_geom(const notcurses* nc, const tinfo* tcache, if(bset->geom == NCBLIT_PIXEL && vopts){ if(vopts->n){ if(vopts->n == notcurses_stdplane_const(nc)){ - logerror("Won't blit bitmaps to the standard plane\n"); - return -1; + if(!(vopts->flags & NCVISUAL_OPTION_CHILDPLANE)){ + logerror("Won't blit bitmaps to the standard plane\n"); + return -1; + } } if(vopts->y && !(vopts->flags & NCVISUAL_OPTION_VERALIGNED)){ logerror("Non-origin y placement %d for sprixel\n", vopts->y); @@ -691,11 +693,11 @@ ncvisual* ncvisual_from_bgra(const void* bgra, int rows, int rowstride, int cols return ncv; } -int ncvisual_resize(ncvisual* nc, int rows, int cols){ +int ncvisual_resize(ncvisual* n, int rows, int cols){ if(!visual_implementation.visual_resize){ - return ncvisual_resize_noninterpolative(nc, rows, cols); + return ncvisual_resize_noninterpolative(n, rows, cols); } - if(visual_implementation.visual_resize(nc, rows, cols)){ + if(visual_implementation.visual_resize(n, rows, cols)){ return -1; } return 0; @@ -892,7 +894,7 @@ ncplane* ncvisual_render_pixels(notcurses* nc, ncvisual* ncv, const struct blits int leny, int lenx, ncplane* n, ncscale_e scaling, uint64_t flags, uint32_t transcolor){ ncplane* stdn = notcurses_stdplane(nc); - if(n == stdn){ + if(n == stdn && !(flags & NCVISUAL_OPTION_CHILDPLANE)){ logerror("Won't blit bitmaps to the standard plane\n"); return NULL; }