visual: take placey into account for row calculation

This commit is contained in:
nick black 2021-04-18 10:14:46 -04:00
parent 1e69b48bbd
commit 0ff59e5a95
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
3 changed files with 6 additions and 3 deletions

View File

@ -40,7 +40,7 @@ greatscott(struct notcurses* nc){
return NULL;
}
struct ncvisual_options vopts = {
.y = 1,
.y = 2,
.x = NCALIGN_CENTER,
.blitter = NCBLIT_PIXEL,
.scaling = NCSCALE_SCALE,

View File

@ -559,7 +559,7 @@ int sixel_wipe(const notcurses* nc, sprixel* s, int ycell, int xcell){
(void)nc;
if(s->n->tacache[s->dimx * ycell + xcell] == SPRIXCELL_ANNIHILATED){
//fprintf(stderr, "CACHED WIPE %d %d/%d\n", s->id, ycell, xcell);
return 1; // already annihilated, but still must draw glyph
return 1; // already annihilated FIXME but 0 breaks things
}
change_p2(s->glyph, SIXEL_P2_TRANS);
return -1;

View File

@ -624,7 +624,10 @@ ncplane* ncvisual_render_pixels(notcurses* nc, ncvisual* ncv, const struct blits
if(n == NULL){ // create plane
if(scaling != NCSCALE_NONE && scaling != NCSCALE_NONE_HIRES){
notcurses_term_dim_yx(nc, &disprows, &dispcols);
--disprows; // some terminals scroll when bitmaps hit the last line
if(!(flags & NCVISUAL_OPTION_VERALIGNED)){
// some terminals scroll when bitmaps hit the last line
disprows -= (placey + 1);
}
dispcols *= nc->tcache.cellpixx;
disprows *= nc->tcache.cellpixy;
clamp_to_sixelmax(&nc->tcache, &disprows, &dispcols);