From 03c95b2b14293942600c6796873661366b477be9 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 6 Dec 2020 07:51:08 -0500 Subject: [PATCH] demo: minimal-width debug plane --- src/demo/hud.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/demo/hud.c b/src/demo/hud.c index f13806094..8e3407d88 100644 --- a/src/demo/hud.c +++ b/src/demo/hud.c @@ -97,7 +97,8 @@ debug_toggle(struct notcurses* nc){ .y = 3, .x = NCALIGN_CENTER, .rows = count_debug_lines(output, outputlen) + 1, - .cols = dimx + 1, // so we don't break lines before the true boundary + // 1 plus the max len of debug output so it can print against right border + .cols = 81, .flags = NCPLANE_OPTION_HORALIGNED, }; struct ncplane* n = ncplane_create(notcurses_stdplane(nc), &nopts); @@ -112,7 +113,7 @@ debug_toggle(struct notcurses* nc){ ncplane_set_scrolling(n, true); ncplane_set_fg_rgb(n, 0x0a0a0a); ncplane_set_bg_rgb(n, 0xffffe5); - if(ncplane_puttext(n, 0, NCALIGN_CENTER, output, &outputlen) < 0){ + if(ncplane_puttext(n, 0, NCALIGN_LEFT, output, &outputlen) < 0){ free(output); ncplane_destroy(n); return;