notcurses-keyplot: throw a perimeter around base plane

This commit is contained in:
nick black 2020-04-03 01:38:28 -04:00 committed by Nick Black
parent d2fe768c30
commit b3cda0d09f
2 changed files with 14 additions and 2 deletions

View File

@ -10,12 +10,24 @@ int main(void){
return EXIT_FAILURE;
}
std::unique_ptr<ncpp::Plane> n(nc.get_stdplane ());
ncpp::Cell tl, tr, bl, br, hl, vl;
if(!n->load_double_box(0, 0, tl, tr, bl, br, hl, vl)){
return EXIT_FAILURE;
}
if(!n->perimeter(tl, tr, bl, br, hl, vl, 0)){
return EXIT_FAILURE;
}
ncpp::Plane plotplane{6, 70, 1, 1, nullptr};
struct ncplot_options popts{};
popts.rangex = 60;
popts.detectrange = true;
struct ncplot* plot = ncplot_create(*n, &popts);
struct ncplot* plot = ncplot_create(plotplane, &popts);
char32_t r;
ncinput ni;
// FIXME launch ticker thread
if(!nc.render()){
return EXIT_FAILURE;
}
while(errno = 0, (r = nc.getc(true, &ni)) != (char32_t)-1){
if(r == 0){ // interrupted by signal
continue;

View File

@ -29,7 +29,7 @@ TEST_CASE("Plot") {
CHECK(nullptr == p);
popts.miny = 0;
popts.maxy = 1;
ncplot* p = ncplot_create(n_, &popts);
p = ncplot_create(n_, &popts);
CHECK(nullptr == p);
}