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

Re: gEDA-user: Problem breaking apart an element in the buffer



Fixed.  The problem wasn't that the pads disappeared, they were
created on the wrong layer.  I checked in the attached patch, give it
a try.

Index: buffer.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/buffer.c,v
retrieving revision 1.45
diff -p -U3 -r1.45 buffer.c
--- buffer.c	4 Jan 2008 20:37:18 -0000	1.45
+++ buffer.c	30 Sep 2008 02:15:56 -0000
@@ -591,7 +591,7 @@ SmashBufferElement (BufferTypePtr Buffer
 {
   ElementTypePtr element;
   Cardinal group;
-  LayerTypePtr layer;
+  LayerTypePtr clayer, slayer;
 
   if (Buffer->Data->ElementN != 1)
     {
@@ -634,11 +634,17 @@ SmashBufferElement (BufferTypePtr Buffer
     GetLayerGroupNumberByNumber (max_layer +
 				 (SWAP_IDENT ? SOLDER_LAYER :
 				  COMPONENT_LAYER));
-  layer = &Buffer->Data->Layer[PCB->LayerGroups.Entries[group][0]];
+  clayer = &Buffer->Data->Layer[PCB->LayerGroups.Entries[group][0]];
+  group =
+    GetLayerGroupNumberByNumber (max_layer +
+				 (SWAP_IDENT ? COMPONENT_LAYER :
+				  SOLDER_LAYER));
+  slayer = &Buffer->Data->Layer[PCB->LayerGroups.Entries[group][0]];
   PAD_LOOP (element);
   {
     LineTypePtr line;
-    line = CreateNewLineOnLayer (layer, pad->Point1.X, pad->Point1.Y,
+    line = CreateNewLineOnLayer (TEST_FLAG (ONSOLDERFLAG, pad) ? slayer : clayer,
+				 pad->Point1.X, pad->Point1.Y,
 				 pad->Point2.X, pad->Point2.Y,
 				 pad->Thickness, pad->Clearance, NoFlags ());
     if (line)


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