aboutsummaryrefslogtreecommitdiff
path: root/guess.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2012-04-08 13:06:45 +0000
committerSimon Tatham <anakin@pobox.com>2012-04-08 13:06:45 +0000
commit48fef05eb6c8a70a9d883efd15308332da96e2ba (patch)
treee989c647b4a5a0edc1ffe3bf7edeee38c13b3d78 /guess.c
parent51d1f0f856b92a31cee4985f950a7c6b58169d21 (diff)
downloadpuzzles-48fef05eb6c8a70a9d883efd15308332da96e2ba.zip
puzzles-48fef05eb6c8a70a9d883efd15308332da96e2ba.tar.gz
puzzles-48fef05eb6c8a70a9d883efd15308332da96e2ba.tar.bz2
puzzles-48fef05eb6c8a70a9d883efd15308332da96e2ba.tar.xz
Increase by 1 in every direction the size of the blitter used to save
the background under a Guess coloured peg in mid-drag. Currently it assumes the circle doesn't extend into the next pixel, which the docs for draw_circle warn might happen due to antialiasing. [originally from svn r9450]
Diffstat (limited to 'guess.c')
-rw-r--r--guess.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/guess.c b/guess.c
index a9fc134..88a0024 100644
--- a/guess.c
+++ b/guess.c
@@ -897,7 +897,7 @@ static void game_set_size(drawing *dr, game_drawstate *ds,
assert(ds->pegsz > 0);
assert(!ds->blit_peg); /* set_size is never called twice */
- ds->blit_peg = blitter_new(dr, ds->pegsz, ds->pegsz);
+ ds->blit_peg = blitter_new(dr, ds->pegsz+2, ds->pegsz+2);
}
static float *game_colours(frontend *fe, int *ncolours)
@@ -1290,11 +1290,10 @@ static void game_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate,
if (ui->drag_col != 0) {
int ox = ui->drag_x - (PEGSZ/2);
int oy = ui->drag_y - (PEGSZ/2);
- debug(("Saving to blitter at (%d,%d)", ox, oy));
- blitter_save(dr, ds->blit_peg, ox, oy);
+ ds->blit_ox = ox - 1; ds->blit_oy = oy - 1;
+ debug(("Saving to blitter at (%d,%d)", ds->blit_ox, ds->blit_oy));
+ blitter_save(dr, ds->blit_peg, ds->blit_ox, ds->blit_oy);
draw_peg(dr, ds, ox, oy, TRUE, ui->show_labels, ui->drag_col);
-
- ds->blit_ox = ox; ds->blit_oy = oy;
}
ds->drag_col = ui->drag_col;