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.
This commit is contained in:
Ben Harris
2022-11-25 13:29:04 +00:00
parent 5a2ea91cad
commit 0b36c01639

View File

@ -34,8 +34,8 @@ enum {
#else #else
#define BORDER (TILE_SIZE * 3 / 2) #define BORDER (TILE_SIZE * 3 / 2)
#endif #endif
#define HIGHLIGHT_WIDTH (TILE_SIZE / 10) #define HIGHLIGHT_WIDTH (TILE_SIZE / 10 ? TILE_SIZE / 10 : 1)
#define OUTER_HIGHLIGHT_WIDTH (BORDER / 10) #define OUTER_HIGHLIGHT_WIDTH (BORDER / 10 ? BORDER / 10 : 1)
#define COORD(x) ( (x) * TILE_SIZE + BORDER ) #define COORD(x) ( (x) * TILE_SIZE + BORDER )
#define FROMCOORD(x) ( ((x) - BORDER + TILE_SIZE) / TILE_SIZE - 1 ) #define FROMCOORD(x) ( ((x) - BORDER + TILE_SIZE) / TILE_SIZE - 1 )