shithub: puzzles

Download patch

ref: 0b36c01639c4b2f52e49c086b6d645883fbea397
parent: 5a2ea91cad4dd34fb766498a032294eb3c7a09b2
author: Ben Harris <bjh21@bjh21.me.uk>
date: Fri Nov 25 08:29:04 EST 2022

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.

--- a/mines.c
+++ b/mines.c
@@ -34,8 +34,8 @@
 #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 )