From 56237fa5fa0c2c56785f3667cb7d013dc9779352 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Mon, 31 Jul 2023 22:39:33 +0100 Subject: [PATCH] Same Game: scale TILE_GAP with tilesize TILE_GAP represents the gap between the coloured parts of adjacent different-coloured tiles. Rather than a fixed 2 pixels, it's now 1/16 of the tilesize (rounded to nearest). This looks the same at the default tilesize of 32, but behaves better with larger or smaller tilesizes. At tilesizes below 8, the gap disappears altogether, but that seems appropriate: at 7 pixels there's not much space for the inner and outer squares and the cursor, and those are all more important than the gap.. --- samegame.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samegame.c b/samegame.c index 33e99c2..99b0df4 100644 --- a/samegame.c +++ b/samegame.c @@ -1370,7 +1370,7 @@ static game_state *execute_move(const game_state *from, const char *move) static void game_set_size(drawing *dr, game_drawstate *ds, const game_params *params, int tilesize) { - ds->tilegap = 2; + ds->tilegap = (tilesize + 8) / 16; ds->tileinner = tilesize - ds->tilegap; }