simon-git: puzzles (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Thu Jan 27 18:51:25 GMT 2022
TL;DR:
534384e Mosaic: fix inconsistently drawn keyboard cursor.
0702904 Mosaic: fix uninitialised field in dup_game().
c44e915 Pearl: permit drawing a whole loop in one drag.
c43a34f Pearl: reorder helper functions.
Repository: https://git.tartarus.org/simon/puzzles.git
On the web: https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer: Simon Tatham <anakin at pobox.com>
Date: 2022-01-27 18:51:25
commit 534384e5de95e8d4d0f60277befc922b6796b705
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=534384e5de95e8d4d0f60277befc922b6796b705;hp=229d062d6ce63f0a5e00d2de62ee0fb389ccfdb6
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Jan 27 18:25:14 2022 +0000
Mosaic: fix inconsistently drawn keyboard cursor.
Every call to draw_cell() was drawing a region including the whole
border of the cell, so that the calls overlapped. So if the cursor
moved left or up, then a COL_CURSOR outline would be drawn around the
new cell, and then a COL_GRID outline would be drawn around the old
cell, overwriting part of the cursor border.
I've fixed this in the rigorous way, by making draw_cell() calls cover
disjoint areas of the puzzle canvas, and using clip() to enforce that.
So now the single DRAWFLAG_CURSOR is replaced by a system of four
flags, indicating that the cell being drawn is the actual cursor
position, or the cell below it (hence containing the cursor's bottom
border), or to its right (needing the left border), or below _and_ to
the right (you still need the single pixel at the cursor's bottom
right corner!).
Also, to ensure the cursor edges are drawn even on the bottom or right
grid boundaries, draw_cell() is called for a set of virtual cells
beyond the actual grid bounds, with additional flags telling it not to
draw an actual puzzle cell there, just the relevant pieces of border.
mosaic.c | 103 +++++++++++++++++++++++++++++++++++++++++----------------------
1 file changed, 68 insertions(+), 35 deletions(-)
commit 07029044b7f525f2aa930b28ee809d1834e44920
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=07029044b7f525f2aa930b28ee809d1834e44920;hp=534384e5de95e8d4d0f60277befc922b6796b705
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Jan 27 18:29:21 2022 +0000
Mosaic: fix uninitialised field in dup_game().
not_completed_clues wasn't being copied from the previous game state,
and was left uninitialised, so that its value was indeterminate.
mosaic.c | 1 +
1 file changed, 1 insertion(+)
commit c44e91567cfdb92ba9fcc6272cf1997134c58239
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=c44e91567cfdb92ba9fcc6272cf1997134c58239;hp=07029044b7f525f2aa930b28ee809d1834e44920
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Jan 27 18:32:33 2022 +0000
Pearl: permit drawing a whole loop in one drag.
A user reported recently that they were trying this as an extra
challenge (solve the whole puzzle mentally and then draw it in
finished form in one UI action). But the backtracking behaviour of
Pearl's dragging mode meant that the loop erased itself as soon as the
drag came back to a revisited position.
In this commit I fix that by making the exception that you can
unconditionally return to the start point of the drag, _provided_ that
in doing so you don't create a grid cell of degree > 2.
pearl.c | 36 +++++++++++++++++++++++++++++++++++-
1 file changed, 35 insertions(+), 1 deletion(-)
commit c43a34fbfe430d235bafc379595761880a19ed9f
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=c43a34fbfe430d235bafc379595761880a19ed9f;hp=c44e91567cfdb92ba9fcc6272cf1997134c58239
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Jan 27 18:48:47 2022 +0000
Pearl: reorder helper functions.
interpret_ui_drag is now called from update_ui_drag, so it makes more
sense to have the former appear first in the file, together with its
comment explaining the expected usage.
pearl.c | 97 +++++++++++++++++++++++++++++++----------------------------------
1 file changed, 46 insertions(+), 51 deletions(-)
More information about the tartarus-commits
mailing list