Ben, as far as I can tell this is yours.  It broke on the 2nd-ish.
The LayerN patch sounds familiar (we've had this bug before).

revision 1.122
date: 2007/12/02 08:44:52;  author: bjj;  state: Exp;  lines: +10 -4
Partial fix? [ 1775101 ] Undo with the line tool sometimes switches to wrong 
node
If you auto-drc and you extend a line (causing a delete and re-add of a
longer line), then undo, this patch ensures the restored short segment
has FOUNDFLAG so you can continue drawing.

revision 1.68
date: 2007/12/02 09:35:40;  author: bjj;  state: Exp;  lines: +3 -3
Data->LayerN should generally be avoided.  It's not initialized for buffers.
All buffers should have max_layer available (which is a macro for
PCB->Data->LayerN, the number of layers in the current board).

revision 1.59
date: 2007/12/02 09:35:40;  author: bjj;  state: Exp;  lines: +9 -9
Data->LayerN should generally be avoided.  It's not initialized for buffers.
All buffers should have max_layer available (which is a macro for
PCB->Data->LayerN, the number of layers in the current board).

diff -U 1 -x CVS -r src-good/action.c src-bad/action.c
--- src-good/action.c   2007-12-19 18:31:49.000000000 -0500
+++ src-bad/action.c    2007-12-19 18:32:24.000000000 -0500
@@ -1,2 +1,2 @@
-/* $Id: action.c,v 1.121 2007/12/02 04:24:06 bjj Exp $ */
+/* $Id: action.c,v 1.122 2007/12/02 08:44:52 bjj Exp $ */
 
@@ -76,3 +76,3 @@
 
-RCSID ("$Id: action.c,v 1.121 2007/12/02 04:24:06 bjj Exp $");
+RCSID ("$Id: action.c,v 1.122 2007/12/02 08:44:52 bjj Exp $");
 
@@ -1227,5 +1227,5 @@
            {
-             /* We will paint only the second line segment.
+             /* We will only need to paint the second line segment.
                 Since we only check for vias on the first segment,
-                swap them so we only paint the first segment. */
+                swap them so the non-empty segment is the first segment. */
              Crosshair.AttachedLine.Point2.X = Note.X;
@@ -5993,2 +5993,8 @@
                  ptr2 = (LineTypePtr) ptrtmp;
+                 if (TEST_FLAG (AUTODRCFLAG, PCB))
+                   {
+                     /* undo loses FOUNDFLAG */
+                     SET_FLAG(FOUNDFLAG, ptr2);
+                     DrawLine (CURRENT, ptr2, 0);
+                   }
                  Crosshair.AttachedLine.Point1.X =
Binary files src-good/action.o and src-bad/action.o differ
diff -U 1 -x CVS -r src-good/misc.c src-bad/misc.c
--- src-good/misc.c     2007-12-19 18:31:49.000000000 -0500
+++ src-bad/misc.c      2007-12-19 18:32:24.000000000 -0500
@@ -1,2 +1,2 @@
-/* $Id: misc.c,v 1.67 2007/11/14 04:17:43 djdelorie Exp $ */
+/* $Id: misc.c,v 1.68 2007/12/02 09:35:40 bjj Exp $ */
 
@@ -80,3 +80,3 @@
 
-RCSID ("$Id: misc.c,v 1.67 2007/11/14 04:17:43 djdelorie Exp $");
+RCSID ("$Id: misc.c,v 1.68 2007/12/02 09:35:40 bjj Exp $");
 
@@ -446,3 +446,3 @@
   hasNoObjects &= (Data->ElementN == 0);
-  for (i = 0; i < Data->LayerN + 2; i++)
+  for (i = 0; i < max_layer + 2; i++)
     hasNoObjects = hasNoObjects &&
Binary files src-good/misc.o and src-bad/misc.o differ
Binary files src-good/pcb and src-bad/pcb differ
diff -U 1 -x CVS -r src-good/polygon.c src-bad/polygon.c
--- src-good/polygon.c  2007-12-19 18:31:49.000000000 -0500
+++ src-bad/polygon.c   2007-12-19 18:32:25.000000000 -0500
@@ -1,2 +1,2 @@
-/* $Id: polygon.c,v 1.58 2007/11/30 05:54:10 bjj Exp $ */
+/* $Id: polygon.c,v 1.59 2007/12/02 09:35:40 bjj Exp $ */
 
@@ -63,3 +63,3 @@
 
-RCSID ("$Id: polygon.c,v 1.58 2007/11/30 05:54:10 bjj Exp $");
+RCSID ("$Id: polygon.c,v 1.59 2007/12/02 09:35:40 bjj Exp $");
 
@@ -707,3 +707,3 @@
   Cardinal i, j;
-  for (i = 0; i < Data->LayerN; i++)
+  for (i = 0; i < max_layer; i++)
     for (j = 0; j < ((PCBType *) (Data->pcb))->LayerGroups.Number[i]; j++)
@@ -724,6 +724,6 @@
   if (!TEST_FLAG (CLEARPOLYFLAG, polygon)
-      || GetLayerNumber (Data, Layer) >= Data->LayerN)
+      || GetLayerNumber (Data, Layer) >= max_layer)
     return 0;
   group = Group (Data, GetLayerNumber (Data, Layer));
-  info.solder = (group == Group (Data, Data->LayerN + SOLDER_LAYER));
+  info.solder = (group == Group (Data, max_layer + SOLDER_LAYER));
   info.data = Data;
@@ -753,3 +753,3 @@
       END_LOOP;
-      if (info.solder || group == Group (Data, Data->LayerN + COMPONENT_LAYER))
+      if (info.solder || group == Group (Data, max_layer + COMPONENT_LAYER))
        r += r_search (Data->pad_tree, &region, NULL, pad_sub_callback, &info);
@@ -1207,3 +1207,3 @@
         {
-          LAYER_LOOP (Data, Data->LayerN);
+          LAYER_LOOP (Data, max_layer);
           {
@@ -1234,3 +1234,3 @@
       /* silk doesn't plow */
-      if (GetLayerNumber (Data, ptr1) >= Data->LayerN)
+      if (GetLayerNumber (Data, ptr1) >= max_layer)
         return 0;
@@ -1249,3 +1249,3 @@
           COMPONENT_LAYER;
-        group = GetLayerGroupNumberByNumber (Data->LayerN + group);
+        group = GetLayerGroupNumberByNumber (max_layer + group);
         GROUP_LOOP (Data, group);
Binary files src-good/polygon.o and src-bad/polygon.o differ


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

Reply via email to