On Wed, 2008-12-17 at 06:42 -0800, Edward Hennessy wrote:
> On Dec 17, 2008, at 12:48 AM, Peter Clifton wrote:

> m_circle_shortest_distance(CIRCLE* circle, int x, int y, gboolean  
> solid);
> m_box_shortest_distance(BOX* box, int x, int y, gboolean solid);
> m_line_shortest_distance(LINE* line, int x, int y);

Lets not do that until we have an internal need for a given function.
m_line_shortest_distance is the only one which is useful to the current
code, and the workaround wasn't that ugly:

diff --git a/libgeda/src/m_polygon.c b/libgeda/src/m_polygon.c
index 8ee6145..175e6fc 100644
--- a/libgeda/src/m_polygon.c
+++ b/libgeda/src/m_polygon.c
@@ -168,8 +168,11 @@ double m_polygon_shortest_distance (GArray *points, int x, 
 
     while (i < points->len) {
       double distance;
+      OBJECT object;
       LINE line;
 
+      object.line = &line;
+
       line.x[0] = point.x;
       line.y[0] = point.y;
 
@@ -178,7 +181,7 @@ double m_polygon_shortest_distance (GArray *points, int x, i
       line.x[1] = point.x;
       line.y[1] = point.y;
 
-      distance = o_line_shortest_distance (&line, x, y);
+      distance = o_line_shortest_distance (&object, x, y);
 
       shortest = min (shortest, distance);
     }


Your help with all this has been much appreciated, I'd say that the
support for curved paths would not have happened for 1.5.1 and beyond if
it was not for your work with the geometry of it all.

Best regards,

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



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

Reply via email to