diff options
| author | Simon Tatham <anakin@pobox.com> | 2009-02-24 07:49:01 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2009-02-24 07:49:01 +0000 |
| commit | cc7024b43367b959ec0ab2b6a225623c5d29bb8b (patch) | |
| tree | c529473ebcc496c1058924d12145652093bd654a | |
| parent | 649719a96471c0782a23c495c94e656b6f579ad9 (diff) | |
| download | puzzles-cc7024b43367b959ec0ab2b6a225623c5d29bb8b.zip puzzles-cc7024b43367b959ec0ab2b6a225623c5d29bb8b.tar.gz puzzles-cc7024b43367b959ec0ab2b6a225623c5d29bb8b.tar.bz2 puzzles-cc7024b43367b959ec0ab2b6a225623c5d29bb8b.tar.xz | |
Fix cosmetic glitch in the interaction between Killer and Jigsaw
modes.
[originally from svn r8463]
| -rw-r--r-- | solo.c | 41 |
1 files changed, 34 insertions, 7 deletions
@@ -4723,10 +4723,37 @@ static void draw_number(drawing *dr, game_drawstate *ds, game_state *state, if (state->kblocks) { int t = GRIDEXTRA * 3; - int kl = cx - 1, kt = cy - 1, kr = cx + cw, kb = cy + ch; + int kcx, kcy, kcw, kch; + int kl, kt, kr, kb; int has_left = 0, has_right = 0, has_top = 0, has_bottom = 0; /* + * In non-jigsaw mode, the Killer cages are placed at a + * fixed offset from the outer edge of the cell dividing + * lines, so that they look right whether those lines are + * thick or thin. In jigsaw mode, however, doing this will + * sometimes cause the cage outlines in adjacent squares to + * fail to match up with each other, so we must offset a + * fixed amount from the _centre_ of the cell dividing + * lines. + */ + if (state->blocks->r == 1) { + kcx = tx; + kcy = ty; + kcw = tw; + kch = th; + } else { + kcx = cx; + kcy = cy; + kcw = cw; + kch = ch; + } + kl = kcx - 1; + kt = kcy - 1; + kr = kcx + kcw; + kb = kcy + kch; + + /* * First, draw the lines dividing this area from neighbouring * different areas. */ @@ -4759,20 +4786,20 @@ static void draw_number(drawing *dr, game_drawstate *ds, game_state *state, if (x+1 < cr && y > 0 && !has_right && !has_top && state->kblocks->whichblock[y*cr+x] != state->kblocks->whichblock[(y-1)*cr+x+1]) { - draw_line(dr, cx + cw - t, kt + t, cx + cw, kt + t, col_killer); - draw_line(dr, cx + cw - t, kt, cx + cw - t, kt + t, col_killer); + draw_line(dr, kcx + kcw - t, kt + t, kcx + kcw, kt + t, col_killer); + draw_line(dr, kcx + kcw - t, kt, kcx + kcw - t, kt + t, col_killer); } if (x > 0 && y+1 < cr && !has_left && !has_bottom && state->kblocks->whichblock[y*cr+x] != state->kblocks->whichblock[(y+1)*cr+x-1]) { - draw_line(dr, kl, cy + ch - t, kl + t, cy + ch - t, col_killer); - draw_line(dr, kl + t, cy + ch - t, kl + t, cy + ch, col_killer); + draw_line(dr, kl, kcy + kch - t, kl + t, kcy + kch - t, col_killer); + draw_line(dr, kl + t, kcy + kch - t, kl + t, kcy + kch, col_killer); } if (x+1 < cr && y+1 < cr && !has_right && !has_bottom && state->kblocks->whichblock[y*cr+x] != state->kblocks->whichblock[(y+1)*cr+x+1]) { - draw_line(dr, cx + cw - t, cy + ch - t, cx + cw - t, cy + ch, col_killer); - draw_line(dr, cx + cw - t, cy + ch - t, cx + cw, cy + ch - t, col_killer); + draw_line(dr, kcx + kcw - t, kcy + kch - t, kcx + kcw - t, kcy + kch, col_killer); + draw_line(dr, kcx + kcw - t, kcy + kch - t, kcx + kcw, kcy + kch - t, col_killer); } } |