aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-06-22 23:34:48 +0100
committerBen Harris <bjh21@bjh21.me.uk>2023-06-26 09:17:01 +0100
commit0d005b526ed554a165a83557512e745c8de335d6 (patch)
tree4777f05d06bc395f69635fb26df4c54ca7fa99f5
parentc5076be383d7630d70666a543306c8f6ee65edb9 (diff)
downloadpuzzles-0d005b526ed554a165a83557512e745c8de335d6.zip
puzzles-0d005b526ed554a165a83557512e745c8de335d6.tar.gz
puzzles-0d005b526ed554a165a83557512e745c8de335d6.tar.bz2
puzzles-0d005b526ed554a165a83557512e745c8de335d6.tar.xz
Pearl: slightly better handling of clicks outside the grid
In Pearl, a mouse-down outside the grid sets ui->ndragcoords to -1. The intended effect of this is to make sure that future drags are ignored, so you can't try to draw a line starting off the grid. However, this also has the effect of clearing any in-progress drag. This can happen if there's a keyboard "drag" in progress at the time. This is arguably wrong, but much more wrong was that interpret_move returned MOVE_UNUSED (and previously NULL) in this case. That meant that the display didn't get updated to show the abandonment of the drag, or the removal of the keyboard cursor that also happened. This commit changes MOVE_UNUSED to MOVE_UI_UPDATE so that at least the effect is correctly visible.
-rw-r--r--pearl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pearl.c b/pearl.c
index 34abf2a..402273f 100644
--- a/pearl.c
+++ b/pearl.c
@@ -2175,7 +2175,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
if (!INGRID(state, gx, gy)) {
ui->ndragcoords = -1;
- return MOVE_UNUSED;
+ return MOVE_UI_UPDATE;
}
ui->clickx = x; ui->clicky = y;