[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: PCB needs alternate grid



Try this patch.  New default: cursor inside pin/pad snaps to it
regardless of grid, unless you hold the shift key, then it does what
it used to do (snap to grid or pin, whichever is closer).

Index: crosshair.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/crosshair.c,v
retrieving revision 1.32
diff -p -U3 -r1.32 crosshair.c
--- crosshair.c	21 Apr 2007 19:00:46 -0000	1.32
+++ crosshair.c	24 Oct 2007 04:32:29 -0000
@@ -842,8 +842,9 @@ FitCrosshairIntoGrid (LocationType X, Lo
 	  py = pad->Point2.Y;
 	}
 
-      if (SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) >
-	  SQUARE (px - Crosshair.X) + SQUARE (py - Crosshair.Y))
+      if (!gui->shift_is_pressed()
+	  || (SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) >
+	      SQUARE (px - Crosshair.X) + SQUARE (py - Crosshair.Y)))
 	{
 	  x0 = px;
 	  y0 = py;
@@ -853,9 +854,10 @@ FitCrosshairIntoGrid (LocationType X, Lo
   else if (ans & (PIN_TYPE | VIA_TYPE))
     {
       PinTypePtr pin = (PinTypePtr) ptr2;
-      if (SQUARE (x0 - Crosshair.X) +
-	  SQUARE (y0 - Crosshair.Y) >
-	  SQUARE (pin->X - Crosshair.X) + SQUARE (pin->Y - Crosshair.Y))
+      if (!gui->shift_is_pressed()
+	  || (SQUARE (x0 - Crosshair.X) +
+	      SQUARE (y0 - Crosshair.Y) >
+	      SQUARE (pin->X - Crosshair.X) + SQUARE (pin->Y - Crosshair.Y)))
 	{
 	  x0 = pin->X;
 	  y0 = pin->Y;


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user