From: Jonas Kölker Date: Thu, 1 Oct 2015 15:42:48 +0000 (+0200) Subject: Fix a misrendering in Guess. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=sgt-puzzles.git;a=commitdiff_plain;h=8889fafb07d47ba359ad071789f340df866a0321 Fix a misrendering in Guess. When the cursor was visible, redrawing after undo-redo or label toggling or resizing would draw background over the top of the circular cursor. --- diff --git a/guess.c b/guess.c index 5a53b01..37030d1 100644 --- a/guess.c +++ b/guess.c @@ -1247,29 +1247,31 @@ static void game_redraw(drawing *dr, game_drawstate *ds, } /* draw the guesses (so far) and the hints - * (in reverse order to avoid trampling holds) */ + * (in reverse order to avoid trampling holds, and postponing the + * next_go'th to not overrender the top of the circular cursor) */ for (i = state->params.nguesses - 1; i >= 0; i--) { - if (state->next_go > i || state->solved) { + if (i < state->next_go || state->solved) { /* this info is stored in the game_state already */ guess_redraw(dr, ds, i, state->guesses[i], NULL, -1, 0, ui->show_labels); hint_redraw(dr, ds, i, state->guesses[i], i == (state->next_go-1) ? 1 : 0, FALSE, FALSE); - } else if (state->next_go == i) { - /* this is the one we're on; the (incomplete) guess is - * stored in the game_ui. */ - guess_redraw(dr, ds, i, ui->curr_pegs, - ui->holds, ui->display_cur ? ui->peg_cur : -1, 0, - ui->show_labels); - hint_redraw(dr, ds, i, NULL, 1, - ui->display_cur && ui->peg_cur == state->params.npegs, - ui->markable); - } else { + } else if (i > state->next_go) { /* we've not got here yet; it's blank. */ guess_redraw(dr, ds, i, NULL, NULL, -1, 0, ui->show_labels); hint_redraw(dr, ds, i, NULL, 0, FALSE, FALSE); } } + if (!state->solved) { + /* this is the one we're on; the (incomplete) guess is stored in + * the game_ui. */ + guess_redraw(dr, ds, state->next_go, ui->curr_pegs, + ui->holds, ui->display_cur ? ui->peg_cur : -1, 0, + ui->show_labels); + hint_redraw(dr, ds, state->next_go, NULL, 1, + ui->display_cur && ui->peg_cur == state->params.npegs, + ui->markable); + } /* draw the 'current move' and 'able to mark' sign. */ if (new_move)