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

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



The branch, master has been updated
       via  4e60f8903dba10c0acad8a912bd8affe76bee2fa (commit)
      from  434c8d98aeed40ec39ad4beb90210328cc6789b5 (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 |   32 ++------------------------------
 1 files changed, 2 insertions(+), 30 deletions(-)


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

commit 4e60f8903dba10c0acad8a912bd8affe76bee2fa
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    crosshair.c: Drop checks to ensure the crosshair is inside the PCB
    
    It would seem that the MIN, MAX functions applied when setting
    Crosshair.X and Crosshair.Y should already constrain the coordinates
    such that the removed code was never triggered.
    
    It isn't obvious that these removed checks are even correct, or are
    being triggered. Drop the checks in the hope that the now simplified
    code continues to "just work" without the special casing.

:100644 100644 b7f3d91... b5e35f5... M	src/crosshair.c

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

commit 4e60f8903dba10c0acad8a912bd8affe76bee2fa
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    crosshair.c: Drop checks to ensure the crosshair is inside the PCB
    
    It would seem that the MIN, MAX functions applied when setting
    Crosshair.X and Crosshair.Y should already constrain the coordinates
    such that the removed code was never triggered.
    
    It isn't obvious that these removed checks are even correct, or are
    being triggered. Drop the checks in the hope that the now simplified
    code continues to "just work" without the special casing.

diff --git a/src/crosshair.c b/src/crosshair.c
index b7f3d91..b5e35f5 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -840,36 +840,8 @@ FitCrosshairIntoGrid (LocationType X, LocationType Y)
     }
   else
     {
-      /* check if new position is inside the output window
-       * This might not be true after the window has been resized.
-       * In this case we just set it to the center of the window or
-       * with respect to the grid (if possible)
-       */
-      if (Crosshair.X < 0 || Crosshair.X > PCB->MaxWidth)
-	{
-	  if (PCB->MaxWidth + 1 >= PCB->Grid)
-	    /* there must be a point that matches the grid 
-	     * so we just have to look for it with some integer
-	     * calculations
-	     */
-	    x = GRIDFIT_X (PCB->Grid, PCB->Grid);
-	  else
-	    x = PCB->MaxWidth / 2;
-	}
-      else
-	/* check if the new position matches the grid */
-	x = GRIDFIT_X (Crosshair.X, PCB->Grid);
-
-      /* do the same for the second coordinate */
-      if (Crosshair.Y < 0 || Crosshair.Y > PCB->MaxHeight)
-	{
-	  if (PCB->MaxHeight + 1 >= PCB->Grid)
-	    y = GRIDFIT_Y (PCB->Grid, PCB->Grid);
-	  else
-	    y = PCB->MaxHeight / 2;
-	}
-      else
-	y = GRIDFIT_Y (Crosshair.Y, PCB->Grid);
+      x = GRIDFIT_X (Crosshair.X, PCB->Grid);
+      y = GRIDFIT_Y (Crosshair.Y, PCB->Grid);
 
       if (Marked.status && TEST_FLAG (ORTHOMOVEFLAG, PCB))
 	{




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