From 4f876cf962eb835dca42c4af2f65a03cc7169835 Mon Sep 17 00:00:00 2001 From: nick black Date: Sat, 20 Mar 2021 01:26:32 -0400 Subject: [PATCH] [demo] always place HUD in the right place --- src/demo/hud.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/demo/hud.c b/src/demo/hud.c index 5d755dbed..fc0adc8d4 100644 --- a/src/demo/hud.c +++ b/src/demo/hud.c @@ -398,7 +398,9 @@ struct ncplane* hud_create(struct notcurses* nc){ int yoffset = dimy - HUD_ROWS; struct ncplane_options nopts = { .y = yoffset, - .x = 9, + // we want it to start tucked right up underneath the title of the FPS + // graph. graph is min(80, dimx) wide, centered, and we want 6 in. + .x = (dimx - (dimx > 80 ? 80 : dimx)) / 2 + 6, .rows = HUD_ROWS, .cols = HUD_COLS, .userptr = NULL,