sliders: always an even width, for centering 2-digit IDs

pull/384/head
nick black 4 years ago
parent 9206329ea7
commit 5980c9ae66
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -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;

Loading…
Cancel
Save