Some experimentation has led me to this patch, does it make sense?
It's a little agressive (4* instead of 2*) but 2* didn't seem to work,
I don't know if the global "Bloat" was overriding it.

Index: find.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/find.c,v
retrieving revision 1.70
diff -p -U3 -r1.70 find.c
--- find.c      21 Dec 2008 04:17:49 -0000      1.70
+++ find.c      29 Dec 2008 04:32:38 -0000
@@ -2543,6 +2543,27 @@ IsPadInPolygon (PadTypePtr pad, PolygonT
     return IsLineInPolygon ((LineTypePtr) pad, polygon);
 }
 
+/* Same, but doesn't return FALSE just because the pad clears
+   polygons.  */
+Boolean
+IsPadOverPolygon (PadTypePtr pad, PolygonTypePtr polygon)
+{
+  int save_clear, rv;
+  int save_size;
+
+  save_clear = TEST_FLAG (CLEARLINEFLAG, pad);
+  save_size = pad->Thickness;
+
+  CLEAR_FLAG (CLEARLINEFLAG, pad);
+  pad->Thickness += 4*PCB->Bloat + 1;
+
+  rv = IsLineInPolygon ((LineTypePtr) pad, polygon);
+
+  pad->Thickness = save_size;
+  ASSIGN_FLAG (CLEARLINEFLAG, save_clear, pad);
+  return rv;
+}
+
 /* ---------------------------------------------------------------------------
  * checks if a polygon has a connection to a second one
  *
@@ -3641,7 +3662,7 @@ drc_callback (DataTypePtr data, LayerTyp
       break;
     case PAD_TYPE:
       if (pad->Clearance < 2 * PCB->Bloat)
-       if (IsPadInPolygon(pad,polygon))
+       if (IsPadOverPolygon(pad,polygon))
          {
            AddObjectToFlagUndoList (type, ptr1, ptr2, ptr2);
            SET_FLAG (TheFlag, pad);


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

Reply via email to