On Thu, 2007-10-04 at 16:18 +0100, Peter Clifton wrote:
> Hi,
> 
> I've been having difficulty with the latest PCB release -
> specifically,
> the schematic drawing glitching / moving about seemingly randomly.
> 
> ESPECIALLY when zoomed in, working on the back side of a board. Just
> moving the mouse over it can trigger the issue.

Dan has nailed the most of this, and sent me a patch to test. This still
had a minor problem when mousing into the out of bounds area on the RHS
of a board (which would cause it to scroll up / down).

The corrected patch (still with some debug stuff #if 0'd out), is below:

diff -urNad pcb-20070912~/src/hid/gtk/gtkhid-main.c 
pcb-20070912/src/hid/gtk/gtkhid-main.c
--- pcb-20070912~/src/hid/gtk/gtkhid-main.c     2007-10-04 23:40:29.000000000 
+0100
+++ pcb-20070912/src/hid/gtk/gtkhid-main.c      2007-10-04 23:47:20.000000000 
+0100
@@ -1160,6 +1160,7 @@
 void
 ghid_set_crosshair (int x, int y, int action)
 {
+  int need_pan_fixup = FALSE;
 
   if (gport->x_crosshair != x || gport->y_crosshair != y)
     {
@@ -1172,15 +1173,32 @@
        *
        * need_idle_proc ();
        */
-      if ( (x < gport->view_x0) ||
-          (x > gport->view_x0 + gport->view_width) ||
-          (y < gport->view_y0) ||
-          (y > gport->view_y0 + gport->view_height) )
-       {
-         gport->view_x0 = x - gport->view_width / 2;
-         gport->view_y0 = y - gport->view_height / 2;
-         ghid_pan_fixup ();
-       }
+
+#if 0
+printf("(x,y)   = (%d, %d)\n", x, y);
+printf("(Sx,Sy) = (%d, %d)\n", SIDE_X(x), SIDE_Y(y));
+printf("(x0,y0) = (%d, %d)\n", gport->view_x0, gport->view_y0);
+printf("(w,h)   = (%d, %d)\n", gport->view_width, gport->view_height);
+#endif
+
+        if ( (SIDE_X (x) < gport->view_x0) ||
+             (SIDE_X (x) > gport->view_x0 + gport->view_width) )
+          {
+            need_pan_fixup = TRUE;
+            gport->view_x0 = SIDE_X (x) - gport->view_width / 2;
+          }
+
+        if ( (SIDE_Y (y) < gport->view_y0) ||
+             (SIDE_Y (y) > gport->view_y0 + gport->view_height) )
+          {
+            need_pan_fixup = TRUE;
+            gport->view_y0 = SIDE_Y (y) - gport->view_height / 2;
+          }
+
+        if (need_pan_fixup)
+          {
+            ghid_pan_fixup ();
+          }
     }
 
   /*

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev

Reply via email to