From 0b36c01639c4b2f52e49c086b6d645883fbea397 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Fri, 25 Nov 2022 13:29:04 +0000 Subject: [PATCH] mines: Ensure highlights don't vanish at small tile sizes The highlights for covered squares now have a minimum width of 1 pixel, which means that Mines is comfortably playabale down to about 8 pixel tilesize, below which the numbers become unreadable. --- mines.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mines.c b/mines.c index e977ac2..1103cc7 100644 --- a/mines.c +++ b/mines.c @@ -34,8 +34,8 @@ enum { #else #define BORDER (TILE_SIZE * 3 / 2) #endif -#define HIGHLIGHT_WIDTH (TILE_SIZE / 10) -#define OUTER_HIGHLIGHT_WIDTH (BORDER / 10) +#define HIGHLIGHT_WIDTH (TILE_SIZE / 10 ? TILE_SIZE / 10 : 1) +#define OUTER_HIGHLIGHT_WIDTH (BORDER / 10 ? BORDER / 10 : 1) #define COORD(x) ( (x) * TILE_SIZE + BORDER ) #define FROMCOORD(x) ( ((x) - BORDER + TILE_SIZE) / TILE_SIZE - 1 )