shithub: puzzles

Download patch

ref: 2aa5708bc725cb48a0d6629dc97bad2fd8cad414
parent: f7c2d45fba037b33434d613b2afced47f40f6738
author: Ben Harris <bjh21@bjh21.me.uk>
date: Thu Aug 10 20:39:28 EDT 2023

Rectangles: use new move_cursor() features

--- a/rect.c
+++ b/rect.c
@@ -2415,11 +2415,11 @@
         enddrag = true;
         erasing = (button == RIGHT_RELEASE);
     } else if (IS_CURSOR_MOVE(button)) {
-        move_cursor(button, &ui->cur_x, &ui->cur_y, from->w, from->h, false,
-                    NULL);
-        ui->cur_visible = true;
+        char *ret;
+        ret = move_cursor(button, &ui->cur_x, &ui->cur_y, from->w, from->h,
+                          false, &ui->cur_visible);
         active = true;
-        if (!ui->cur_dragging) return MOVE_UI_UPDATE;
+        if (!ui->cur_dragging || ret != MOVE_UI_UPDATE) return ret;
         coord_round((float)ui->cur_x + 0.5F, (float)ui->cur_y + 0.5F, &xc, &yc);
     } else if (IS_CURSOR_SELECT(button)) {
         if (ui->drag_start_x >= 0 && !ui->cur_dragging) {