From 8dc396c916fc5c52249a17d465c099750d215be2 Mon Sep 17 00:00:00 2001 From: nick black Date: Tue, 9 Nov 2021 03:39:00 -0500 Subject: [PATCH] [chunli] use centering options --- src/demo/chunli.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/demo/chunli.c b/src/demo/chunli.c index 411e3bf7a..3277f19e3 100644 --- a/src/demo/chunli.c +++ b/src/demo/chunli.c @@ -74,18 +74,17 @@ int chunli_demo(struct notcurses* nc){ free(path); struct ncplane* ncp; struct ncvisual_options vopts = { + .x = NCALIGN_CENTER, + .y = NCALIGN_CENTER, .n = notcurses_stdplane(nc), - .flags = NCVISUAL_OPTION_CHILDPLANE, + .flags = NCVISUAL_OPTION_CHILDPLANE | + NCVISUAL_OPTION_HORALIGNED | + NCVISUAL_OPTION_VERALIGNED, }; if((ncp = ncvisual_blit(nc, ncv, &vopts)) == NULL){ return -1; } ncplane_set_base_cell(ncp, &b); - unsigned thisx, thisy; - ncplane_dim_yx(ncp, &thisy, &thisx); - if(ncplane_move_yx(ncp, (dimy - thisy) / 2, (dimx - thisx) / 2)){ - return -1; - } DEMO_RENDER(nc); demo_nanosleep(nc, &iterdelay); ncvisual_destroy(ncv);