From abe1eed3baa9617a7b52c861d159f832ffbba4c6 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Wed, 1 Jan 2025 18:49:13 -0500 Subject: [PATCH] Untangle: fix redraws when dragging with cursor keys. The recent addition of graph editor functionality to Untangle in 2ac951e broke redraws while dragging a point using the cursor keys. In particular, the new ui->dragtype field was not being set by the cursor dragging code path, causing redraws to erroneously exit early. Generally, there is quite a bit of code duplication between the cursor and mouse dragging code paths in interpret_move(). Some refactoring could perhaps reduce the chances of this happening again. --- untangle.c | 1 + 1 file changed, 1 insertion(+) diff --git a/untangle.c b/untangle.c index fea80ad..8044936 100644 --- a/untangle.c +++ b/untangle.c @@ -1542,6 +1542,7 @@ static char *interpret_move(const game_state *state, game_ui *ui, } else if(button == CURSOR_SELECT) { if(ui->dragpoint < 0 && ui->cursorpoint >= 0) { /* begin drag */ + ui->dragtype = DRAG_MOVE_POINT; ui->dragpoint = ui->cursorpoint; ui->cursorpoint = -1; ui->newpoint.x = state->pts[ui->dragpoint].x * ds->tilesize / state->pts[ui->dragpoint].d;