shithub: puzzles

Download patch

ref: 6a9a0cd8f6ee83e6fbd3424c337bacfb8e90502a
parent: df2d6d347e7e4dc0d74df708906844ed67b1b358
author: Ben Harris <bjh21@bjh21.me.uk>
date: Wed Aug 9 20:19:38 EDT 2023

Magnets: use new move_cursor() features

--- a/magnets.c
+++ b/magnets.c
@@ -1843,12 +1843,10 @@
     char *nullret = NULL, buf[80], movech;
     enum { CYCLE_MAGNET, CYCLE_NEUTRAL } action;
 
-    if (IS_CURSOR_MOVE(button)) {
-        move_cursor(button, &ui->cur_x, &ui->cur_y, state->w, state->h, false,
-                    NULL);
-        ui->cur_visible = true;
-        return MOVE_UI_UPDATE;
-    } else if (IS_CURSOR_SELECT(button)) {
+    if (IS_CURSOR_MOVE(button))
+        return move_cursor(button, &ui->cur_x, &ui->cur_y, state->w, state->h,
+                           false, &ui->cur_visible);
+    else if (IS_CURSOR_SELECT(button)) {
         if (!ui->cur_visible) {
             ui->cur_visible = true;
             return MOVE_UI_UPDATE;