From 5980c9ae66733968b3c2a810c891c04fefa7654d Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 23 Feb 2020 07:16:07 -0500 Subject: [PATCH] sliders: always an even width, for centering 2-digit IDs --- src/demo/sliding.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/demo/sliding.c b/src/demo/sliding.c index aa909450c..d0f6b63ba 100644 --- a/src/demo/sliding.c +++ b/src/demo/sliding.c @@ -148,6 +148,8 @@ int sliding_puzzle_demo(struct notcurses* nc){ // we want an 8x8 grid of chunks with a border. the leftover space will be unused chunky = (maxy - 2) / CHUNKS_VERT; chunkx = (maxx - 2) / CHUNKS_HORZ; + // want an even width so our 2-digit IDs are centered exactly + chunkx -= (chunkx % 2); // don't allow them to be too rectangular, but keep aspect ratio in mind! if(chunky > chunkx + 1){ chunky = chunkx + 1;