shithub: puzzles

Download patch

ref: 236889f6d6fc9bfb4cf119de5596effbd2bd4781
parent: 4f6e48e6beafd73e052ec2454dc3a69949eee37e
author: Simon Tatham <anakin@pobox.com>
date: Tue Oct 13 13:09:42 EDT 2009

Single mouse clicks to toggle individual grid edges stopped working
in r8414 as a side effect of reorganisation in interpret_move().
Reinstate them.

[originally from svn r8692]
[r8414 == 54801998744a69786a49ebe0688942ae7b57525b]

--- a/rect.c
+++ b/rect.c
@@ -2431,9 +2431,10 @@
 	(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->dragged = TRUE;
         active = TRUE;
 
 	if (xc >= 0 && xc <= 2*from->w &&
@@ -2813,7 +2814,8 @@
     {
 	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,