From f86623bbd93e703f1be6432cc221319543a304e6 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 18 Nov 2022 22:19:40 +0000 Subject: [PATCH] Palisade: scale line thickness unboundedly with tile size. The previous expression for WIDTH defined it, curiously, as (1 + (TILESIZE >= 16) + (TILESIZE >= 32) + (TILESIZE >= 64)) which is roughly logarithmic in tile size, but bounded above by a maximum of 4 pixels. On high-DPI displays this isn't really good enough any more. Now I've set the line thickness to a constant fraction of the tile size (but still bounded below by 1), so it's much easier to see the lines when the puzzle is expanded to extra large size. --- palisade.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/palisade.c b/palisade.c index 58619bf..fdd69cc 100644 --- a/palisade.c +++ b/palisade.c @@ -908,7 +908,7 @@ struct game_drawstate { #define TILESIZE (ds->tilesize) #define MARGIN (ds->tilesize / 2) -#define WIDTH (1 + (TILESIZE >= 16) + (TILESIZE >= 32) + (TILESIZE >= 64)) +#define WIDTH (3*TILESIZE/32 > 1 ? 3*TILESIZE/32 : 1) #define CENTER ((ds->tilesize / 2) + WIDTH/2) #define FROMCOORD(x) (((x) - MARGIN) / TILESIZE)