normal: reenable ncvisual_from_plane()

pull/602/head
nick black 4 years ago
parent b796668044
commit 4d23b6c15e
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -73,8 +73,7 @@ int normal_demo(struct notcurses* nc){
}
free(rgba);
rgba = NULL;
// FIXME ncvisual_from_plane is failing
/*ncv = ncvisual_from_plane(n, 0, 0, -1, -1);
ncv = ncvisual_from_plane(n, 0, 0, -1, -1);
if(!ncv){
goto err;
}
@ -86,7 +85,7 @@ int normal_demo(struct notcurses* nc){
goto err;
}
DEMO_RENDER(nc);
}*/
}
ncvisual_destroy(ncv);
ncplane_destroy(n);
return 0;

@ -113,6 +113,12 @@ auto ncvisual_from_plane(const ncplane* n, int begy, int begx, int leny, int len
}
int dimy, dimx;
ncplane_dim_yx(n, &dimy, &dimx);
if(lenx == -1){
lenx = n->lenx - begx;
}
if(leny == -1){
leny = n->leny - begy;
}
auto* ncv = ncvisual_from_rgba(n->nc, rgba, leny, lenx * 4, lenx);
if(ncv == nullptr){
free(rgba);

Loading…
Cancel
Save