aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-09-18 17:00:07 +0000
committerSimon Tatham <anakin@pobox.com>2005-09-18 17:00:07 +0000
commit71966d06a29099e12aefde94c4c7a81a390ccd4a (patch)
tree21e4c3c8aba5950b7df7b226a5824715f2f44683
parentc8145f3bba1681a4b85e99dd0749d9c434393955 (diff)
downloadpuzzles-71966d06a29099e12aefde94c4c7a81a390ccd4a.zip
puzzles-71966d06a29099e12aefde94c4c7a81a390ccd4a.tar.gz
puzzles-71966d06a29099e12aefde94c4c7a81a390ccd4a.tar.bz2
puzzles-71966d06a29099e12aefde94c4c7a81a390ccd4a.tar.xz
Bug fix from James H: prevent LINEWIDTH ever reaching zero.
[originally from svn r6331]
-rw-r--r--loopy.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/loopy.c b/loopy.c
index 71aaa31..3423465 100644
--- a/loopy.c
+++ b/loopy.c
@@ -66,7 +66,7 @@
#define PREFERRED_TILE_SIZE 32
#define TILE_SIZE (ds->tilesize)
-#define LINEWIDTH TILE_SIZE / 16
+#define LINEWIDTH (ds->linewidth)
#define BORDER (TILE_SIZE / 2)
#define FLASH_TIME 0.5F
@@ -2078,7 +2078,7 @@ static void game_changed_state(game_ui *ui, game_state *oldstate,
struct game_drawstate {
int started;
- int tilesize;
+ int tilesize, linewidth;
int flashing;
char *hl, *vl;
char *clue_error;
@@ -2360,6 +2360,7 @@ static void game_set_size(drawing *dr, game_drawstate *ds,
game_params *params, int tilesize)
{
ds->tilesize = tilesize;
+ ds->linewidth = max(1,tilesize/16);
}
static float *game_colours(frontend *fe, game_state *state, int *ncolours)
@@ -2388,7 +2389,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, game_state *state)
{
struct game_drawstate *ds = snew(struct game_drawstate);
- ds->tilesize = 0;
+ ds->tilesize = ds->linewidth = 0;
ds->started = 0;
ds->hl = snewn(HL_COUNT(state), char);
ds->vl = snewn(VL_COUNT(state), char);