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

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



The branch, master has been updated
       via  242490769b668619e6d3aaf91c1ce26687021ffa (commit)
      from  af11dccc573132671942620545c6b2ba7a75d262 (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/crosshair.c |   16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)


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

commit 242490769b668619e6d3aaf91c1ce26687021ffa
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    By popular(*) request, Make the cross-hair snap to the center of pads
    
    * Popular.. or vocal?, I'm not sure.
    
    If more people don't like the new behaviour, there is always git revert.
    
    There was of course, a third possibility - adding support to snap to pad
    end-points _and_ their centers. I rejected this because of "nearly" square
    pads - it becomes difficult to know if you've picked up the center of the
    pad, and many of those asking for snap-to-center wanted it in order to
    pick up and align components by their pads.
    
    NB: Optimised rat-lines still go to the edge of pads, as this can often
        look less cluttered. Rat-lines drawn to the center of a pad will
        work correctly, and remain on the pad center until the next time
        "optimise" is run on the rats-nest.

:100644 100644 8321929... 367922e... M	src/crosshair.c

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

commit 242490769b668619e6d3aaf91c1ce26687021ffa
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    By popular(*) request, Make the cross-hair snap to the center of pads
    
    * Popular.. or vocal?, I'm not sure.
    
    If more people don't like the new behaviour, there is always git revert.
    
    There was of course, a third possibility - adding support to snap to pad
    end-points _and_ their centers. I rejected this because of "nearly" square
    pads - it becomes difficult to know if you've picked up the center of the
    pad, and many of those asking for snap-to-center wanted it in order to
    pick up and align components by their pads.
    
    NB: Optimised rat-lines still go to the edge of pads, as this can often
        look less cluttered. Rat-lines drawn to the center of a pad will
        work correctly, and remain on the pad center until the next time
        "optimise" is run on the rats-nest.

diff --git a/src/crosshair.c b/src/crosshair.c
index 8321929..367922e 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -880,19 +880,9 @@ FitCrosshairIntoGrid (LocationType X, LocationType Y)
     {
       PadTypePtr pad = (PadTypePtr) ptr2;
       LocationType px, py;
-      if (SQUARE (pad->Point1.X - Crosshair.X) +
-	  SQUARE (pad->Point1.Y - Crosshair.Y) <
-	  SQUARE (pad->Point2.X - Crosshair.X) + SQUARE (pad->Point2.Y -
-							 Crosshair.Y))
-	{
-	  px = pad->Point1.X;
-	  py = pad->Point1.Y;
-	}
-      else
-	{
-	  px = pad->Point2.X;
-	  py = pad->Point2.Y;
-	}
+
+      px = (pad->Point1.X + pad->Point2.X) / 2;
+      py = (pad->Point1.Y + pad->Point2.Y) / 2;
 
       if (!gui->shift_is_pressed()
 	  || (SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) >




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