mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
notcurses-keyplot: throw a perimeter around base plane
This commit is contained in:
parent
d2fe768c30
commit
b3cda0d09f
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user