diff --git a/doc/man/man1/notcurses-demo.1.md b/doc/man/man1/notcurses-demo.1.md index cbf7090e9..a569b4366 100644 --- a/doc/man/man1/notcurses-demo.1.md +++ b/doc/man/man1/notcurses-demo.1.md @@ -57,7 +57,7 @@ At any time, press 'q' to quit. The demo is best run in at least a 80x45 termina **-V**: Print the program name and version, and exit with success. -demospec: Select which demos to run, and what order to run them in. The default is **ixetcgpwubvlfsjo**. See above for a list of demos. +demospec: Select which demos to run, and what order to run them in. The default is **ixetbcgpwuvlfsjo**. See above for a list of demos. # NOTES Proper display requires: diff --git a/src/demo/chunli.c b/src/demo/chunli.c index 42aa5f6c3..ca1344e75 100644 --- a/src/demo/chunli.c +++ b/src/demo/chunli.c @@ -52,10 +52,12 @@ chunli_draw(struct notcurses* nc, const char* ext, int count, const cell* b){ int chunli_demo(struct notcurses* nc){ struct timespec iterdelay; timespec_div(&demodelay, 10, &iterdelay); - int averr; + int averr, dimx, dimy; + notcurses_resize(nc, &dimy, &dimx); cell b = CELL_TRIVIAL_INITIALIZER; cell_set_fg_alpha(&b, CELL_ALPHA_TRANSPARENT); cell_set_bg_alpha(&b, CELL_ALPHA_TRANSPARENT); + chunli_draw(nc, "bmp", CHUNS, &b); char file[PATH_MAX]; for(int i = 1 ; i < 100 ; ++i){ snprintf(file, sizeof(file), "chunli%02d.png", i); @@ -74,12 +76,16 @@ int chunli_demo(struct notcurses* nc){ if(ncvisual_render(ncv, 0, 0, 0, 0)){ return -1; } + int thisx, thisy; + ncplane_dim_yx(ncp, &thisy, &thisx); + if(ncplane_move_yx(ncp, (dimy - thisy) / 2, (dimx - thisx) / 2)){ + return -1; + } if(demo_render(nc)){ return -1; } demo_nanosleep(nc, &iterdelay); ncvisual_destroy(ncv); } - chunli_draw(nc, "bmp", CHUNS, &b); return 0; }