diff options
| author | Jonas Kölker <jonaskoelker@yahoo.com> | 2015-10-01 17:42:48 +0200 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2015-10-03 17:08:21 +0100 |
| commit | 8889fafb07d47ba359ad071789f340df866a0321 (patch) | |
| tree | b3f6fa731b9856959d1486fc22feddaeb4ecf5f6 | |
| parent | 5cb91f28ba609d04d8948860c34520b66ea16718 (diff) | |
| download | puzzles-8889fafb07d47ba359ad071789f340df866a0321.zip puzzles-8889fafb07d47ba359ad071789f340df866a0321.tar.gz puzzles-8889fafb07d47ba359ad071789f340df866a0321.tar.bz2 puzzles-8889fafb07d47ba359ad071789f340df866a0321.tar.xz | |
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.
| -rw-r--r-- | guess.c | 26 |
1 files changed, 14 insertions, 12 deletions
@@ -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) |