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

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



The branch, master has been updated
       via  d46ff633fa3f700c3314a4043dc60fa40b4d827f (commit)
      from  23fdbee2cd45accc1f11856e47508cc49251687e (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/search.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


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

commit d46ff633fa3f700c3314a4043dc60fa40b4d827f
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Fix math error in IsPointOnLine()
    
    The math in C didn't match the math in the comment (and, apparently,
    hasn't for quite some time).
    
    To test: Draw three lines, from 1000,3000 to 1500,2500, then to
    2000,3000, then back to the start at 1000,3000.  Without this patch, the
    first and last lines are removed and replaced with a copy of the second
    line.

:100644 100644 f12f473... 60e8dde... M	src/search.c

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

commit d46ff633fa3f700c3314a4043dc60fa40b4d827f
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Fix math error in IsPointOnLine()
    
    The math in C didn't match the math in the comment (and, apparently,
    hasn't for quite some time).
    
    To test: Draw three lines, from 1000,3000 to 1500,2500, then to
    2000,3000, then back to the start at 1000,3000.  Without this patch, the
    first and last lines are removed and replaced with a copy of the second
    line.

diff --git a/src/search.c b/src/search.c
index f12f473..60e8dde 100644
--- a/src/search.c
+++ b/src/search.c
@@ -727,7 +727,7 @@ IsPointOnLine (Coord X, Coord Y, Coord Radius, LineTypePtr Line)
   else              D1 = 0;
   /* Get distance from (X, Y) to Q */
   D2 = ((double) (X - Line->Point1.X) * (Line->Point2.Y - Line->Point1.Y)
-        + (double) (Y - Line->Point1.Y) * (Line->Point2.X - Line->Point1.X)) / L;
+        - (double) (Y - Line->Point1.Y) * (Line->Point2.X - Line->Point1.X)) / L;
   /* Total distance is then the pythagorean sum of these */
   return sqrt (D1*D1 + D2*D2) <= Radius + Line->Thickness / 2;
 }




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