Single mouse clicks to toggle individual grid edges stopped working
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 13 Oct 2009 17:09:42 +0000 (17:09 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 13 Oct 2009 17:09:42 +0000 (17:09 +0000)
in r8414 as a side effect of reorganisation in interpret_move().
Reinstate them.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@8692 cda61777-01e9-0310-a592-d414129be87e

rect.c

diff --git a/rect.c b/rect.c
index af369e1..82256f7 100644 (file)
--- a/rect.c
+++ b/rect.c
@@ -2431,9 +2431,10 @@ static char *interpret_move(game_state *from, game_ui *ui, game_drawstate *ds,
        (xc != ui->drag_end_x || yc != ui->drag_end_y)) {
        int t;
 
        (xc != ui->drag_end_x || yc != ui->drag_end_y)) {
        int t;
 
+       if (ui->drag_end_x != -1 && ui->drag_end_y != -1)
+           ui->dragged = TRUE;
         ui->drag_end_x = xc;
         ui->drag_end_y = yc;
         ui->drag_end_x = xc;
         ui->drag_end_y = yc;
-        ui->dragged = TRUE;
         active = TRUE;
 
        if (xc >= 0 && xc <= 2*from->w &&
         active = TRUE;
 
        if (xc >= 0 && xc <= 2*from->w &&
@@ -2813,7 +2814,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate,
     {
        char buf[256];
 
     {
        char buf[256];
 
-       if (ui->x1 >= 0 && ui->y1 >= 0 &&
+       if (ui->dragged &&
+           ui->x1 >= 0 && ui->y1 >= 0 &&
            ui->x2 >= 0 && ui->y2 >= 0) {
            sprintf(buf, "%dx%d ",
                    ui->x2-ui->x1,
            ui->x2 >= 0 && ui->y2 >= 0) {
            sprintf(buf, "%dx%d ",
                    ui->x2-ui->x1,