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

gEDA-cvs: pcb.git: branch: master updated (af11dccc573132671942620545c6b2ba7a75d262)



The branch, master has been updated
       via  af11dccc573132671942620545c6b2ba7a75d262 (commit)
      from  7781f382e7a3ff1da32948f7f5aa36c96689c1df (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/find.c       |   26 ++++++++++++++------------
 src/rubberband.c |   10 ++++++++++
 2 files changed, 24 insertions(+), 12 deletions(-)


=================
 Commit Messages
=================

commit af11dccc573132671942620545c6b2ba7a75d262
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Add support for rat-lines ending at the center of pads
    
    Optimised rats are still located at the edges of pads, but the rat connection
    checking code will now also accept rats ending at the center of a pad.

:100644 100644 b24512a... 1962234... M	src/find.c
:100644 100644 a806d6d... ec4920f... M	src/rubberband.c

=========
 Changes
=========

commit af11dccc573132671942620545c6b2ba7a75d262
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Add support for rat-lines ending at the center of pads
    
    Optimised rats are still located at the edges of pads, but the rat connection
    checking code will now also accept rats ending at the center of a pad.

diff --git a/src/find.c b/src/find.c
index b24512a..1962234 100644
--- a/src/find.c
+++ b/src/find.c
@@ -2191,10 +2191,12 @@ LOCtoPad_callback (const BoxType * b, void *cl)
   struct rat_info *i = (struct rat_info *) cl;
 
   if (!TEST_FLAG (TheFlag, pad) && i->layer ==
-      (TEST_FLAG (ONSOLDERFLAG, pad) ? SOLDER_LAYER : COMPONENT_LAYER)
-      && (((pad->Point1.X == i->Point->X && pad->Point1.Y == i->Point->Y)) ||
-          ((pad->Point2.X == i->Point->X && pad->Point2.Y == i->Point->Y)))
-      && ADD_PAD_TO_LIST (i->layer, pad))
+	(TEST_FLAG (ONSOLDERFLAG, pad) ? SOLDER_LAYER : COMPONENT_LAYER) &&
+      ((pad->Point1.X == i->Point->X && pad->Point1.Y == i->Point->Y) ||
+       (pad->Point2.X == i->Point->X && pad->Point2.Y == i->Point->Y) ||
+       ((pad->Point1.X + pad->Point2.X) / 2 == i->Point->X &&
+        (pad->Point1.Y + pad->Point2.Y) / 2 == i->Point->Y)) &&
+      ADD_PAD_TO_LIST (i->layer, pad))
     longjmp (i->env, 1);
   return 0;
 }
@@ -2306,19 +2308,19 @@ LOCtoPadRat_callback (const BoxType * b, void *cl)
   if (!TEST_FLAG (TheFlag, rat))
     {
       if (rat->group1 == i->layer &&
-          ((rat->Point1.X == i->pad.Point1.X
-            && rat->Point1.Y == i->pad.Point1.Y)
-           || (rat->Point1.X == i->pad.Point2.X
-               && rat->Point1.Y == i->pad.Point2.Y)))
+	  ((rat->Point1.X == i->pad.Point1.X && rat->Point1.Y == i->pad.Point1.Y) ||
+	   (rat->Point1.X == i->pad.Point2.X && rat->Point1.Y == i->pad.Point2.Y) ||
+	   (rat->Point1.X == (i->pad.Point1.X + i->pad.Point2.X) / 2 &&
+	    rat->Point1.Y == (i->pad.Point1.Y + i->pad.Point2.Y) / 2)))
         {
           if (ADD_RAT_TO_LIST (rat))
             longjmp (i->env, 1);
         }
       else if (rat->group2 == i->layer &&
-               ((rat->Point2.X == i->pad.Point1.X
-                 && rat->Point2.Y == i->pad.Point1.Y)
-                || (rat->Point2.X == i->pad.Point2.X
-                    && rat->Point2.Y == i->pad.Point2.Y)))
+	       ((rat->Point2.X == i->pad.Point1.X && rat->Point2.Y == i->pad.Point1.Y) ||
+		(rat->Point2.X == i->pad.Point2.X && rat->Point2.Y == i->pad.Point2.Y) ||
+		(rat->Point2.X == (i->pad.Point1.X + i->pad.Point2.X) / 2 &&
+		 rat->Point2.Y == (i->pad.Point1.Y + i->pad.Point2.Y) / 2)))
         {
           if (ADD_RAT_TO_LIST (rat))
             longjmp (i->env, 1);
diff --git a/src/rubberband.c b/src/rubberband.c
index a806d6d..ec4920f 100644
--- a/src/rubberband.c
+++ b/src/rubberband.c
@@ -293,6 +293,16 @@ rat_callback (const BoxType * box, void *cl)
 	if (rat->Point2.X == i->pad->Point2.X &&
 	    rat->Point2.Y == i->pad->Point2.Y && rat->group2 == i->group)
 	CreateNewRubberbandEntry (NULL, (LineTypePtr) rat, &rat->Point2);
+      else
+	if (rat->Point1.X == (i->pad->Point1.X + i->pad->Point2.X) / 2 &&
+	    rat->Point1.Y == (i->pad->Point1.Y + i->pad->Point2.Y) / 2 &&
+	    rat->group1 == i->group)
+	CreateNewRubberbandEntry (NULL, (LineTypePtr) rat, &rat->Point1);
+      else
+	if (rat->Point2.X == (i->pad->Point1.X + i->pad->Point2.X) / 2 &&
+	    rat->Point2.Y == (i->pad->Point1.Y + i->pad->Point2.Y) / 2 &&
+	    rat->group2 == i->group)
+	CreateNewRubberbandEntry (NULL, (LineTypePtr) rat, &rat->Point2);
       break;
     case LINEPOINT_TYPE:
       if (rat->group1 == i->group &&




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