diff options
| author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-09-29 14:29:57 +0100 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2017-09-29 17:01:41 +0100 |
| commit | 9b0069b1379f6468a797a886a8520baf57b0fa9f (patch) | |
| tree | 46639694b73e15149d53443d4c99470d10fbf445 /tracks.c | |
| parent | a0435df8aa30af4ea24b4b375bc1e37600bc19fe (diff) | |
| download | puzzles-9b0069b1379f6468a797a886a8520baf57b0fa9f.zip puzzles-9b0069b1379f6468a797a886a8520baf57b0fa9f.tar.gz puzzles-9b0069b1379f6468a797a886a8520baf57b0fa9f.tar.bz2 puzzles-9b0069b1379f6468a797a886a8520baf57b0fa9f.tar.xz | |
tracks: Scale thickness of "no track here" crosses
Simply replace the calls to draw_line with calls to draw_thick_line.
We need to choose a thickness parameter. The preferred tile size is
30, and the "draw_line" function draws a 1-pixel line, so the
thickness right now is 1/30 the tile size, at the preferred size.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tracks.c')
| -rw-r--r-- | tracks.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1719,6 +1719,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate, #define BORDER (TILE_SIZE/8) #define BORDER_WIDTH (max(TILE_SIZE / 32, 1)) +#define LINE_THICK (TILE_SIZE/30) #define COORD(x) ( (x+1) * TILE_SIZE + BORDER ) #define CENTERED_COORD(x) ( COORD(x) + TILE_SIZE/2 ) @@ -2389,8 +2390,8 @@ static void draw_square(drawing *dr, game_drawstate *ds, (flags_drag & DS_NOTRACK) == DS_NOTRACK, &c); if (flags_best) { off = HALFSZ/2; - draw_line(dr, cx - off, cy - off, cx + off, cy + off, c); - draw_line(dr, cx - off, cy + off, cx + off, cy - off, c); + draw_thick_line(dr, LINE_THICK, cx - off, cy - off, cx + off, cy + off, c); + draw_thick_line(dr, LINE_THICK, cx - off, cy + off, cx + off, cy - off, c); } c = COL_TRACK; @@ -2404,8 +2405,8 @@ static void draw_square(drawing *dr, game_drawstate *ds, cx += (d == R) ? t2 : (d == L) ? -t2 : 0; cy += (d == D) ? t2 : (d == U) ? -t2 : 0; - draw_line(dr, cx - off, cy - off, cx + off, cy + off, c); - draw_line(dr, cx - off, cy + off, cx + off, cy - off, c); + draw_thick_line(dr, LINE_THICK, cx - off, cy - off, cx + off, cy + off, c); + draw_thick_line(dr, LINE_THICK, cx - off, cy + off, cx + off, cy - off, c); } } |