ncplane backgrounds: render and use i nsliding-demo #69

pull/87/head
nick black 5 years ago committed by Nick Black
parent c2f377d599
commit 8e96c2d78e

@ -85,7 +85,8 @@ fill_chunk(struct ncplane* n, int idx){
if(ncplane_cursor_move_yx(n, (maxy - 1) / 2, (maxx - 3) / 2)){
return -1;
}
ncplane_fg_rgb8(n, 224, 224, 224);
ncplane_fg_rgb8(n, 255 - r, 255 - g, 255 - b);
ncplane_bg_rgb8(n, r, g, b);
if(ncplane_putstr(n, buf) <= 0){
return -1;
}
@ -96,6 +97,10 @@ fill_chunk(struct ncplane* n, int idx){
cell_release(n, &lr);
cell_release(n, &hl);
cell_release(n, &vl);
cell bg = CELL_TRIVIAL_INITIALIZER;
cell_set_bg(&bg, r, g, b);
ncplane_set_background(n, &bg);
cell_release(n, &bg);
return 0;
}

@ -963,7 +963,11 @@ visible_cell(const notcurses* nc, int y, int x, const ncplane** retp){
if(poffy < p->leny && poffy >= 0){
if(poffx < p->lenx && poffx >= 0){
*retp = p;
return &p->fb[fbcellidx(p, poffy, poffx)];
const cell* vis = &p->fb[fbcellidx(p, poffy, poffx)];
if(vis->gcluster == 0){
vis = &p->background;
}
return vis;
}
}
p = p->z;

Loading…
Cancel
Save