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

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-405-gd785f7c)



The branch, master has been updated
       via  d785f7cf34f581bbb18fbc73dced8e44bc28ab90 (commit)
      from  3d8b3efb5a4ce8672133658ccdbe5c57d341f0fc (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
=========

 libgeda/src/o_text_basic.c |   17 +----------------
 1 files changed, 1 insertions(+), 16 deletions(-)


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

commit d785f7cf34f581bbb18fbc73dced8e44bc28ab90
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 20 04:35:30 2008 +0000

    libgeda: Simplify shortest distance test for text
    
    Since we're always treating the text bouning box as a solid area,
    some of the conditionals can be simplified, as in the picture case.

:100644 100644 c6b1395... 43c22ad... M	libgeda/src/o_text_basic.c

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

commit d785f7cf34f581bbb18fbc73dced8e44bc28ab90
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 20 04:35:30 2008 +0000

    libgeda: Simplify shortest distance test for text
    
    Since we're always treating the text bouning box as a solid area,
    some of the conditionals can be simplified, as in the picture case.

diff --git a/libgeda/src/o_text_basic.c b/libgeda/src/o_text_basic.c
index c6b1395..43c22ad 100644
--- a/libgeda/src/o_text_basic.c
+++ b/libgeda/src/o_text_basic.c
@@ -1812,7 +1812,6 @@ void o_text_mirror_world(TOPLEVEL *toplevel,
  */
 double o_text_shortest_distance (OBJECT *object, int x, int y)
 {
-  double shortest_distance;
   double dx, dy;
 
   g_return_val_if_fail (object->text != NULL, G_MAXDOUBLE);
@@ -1823,21 +1822,7 @@ double o_text_shortest_distance (OBJECT *object, int x, int y)
   dx = min (dx, 0);
   dy = min (dy, 0);
 
-  if (dx < 0) {
-    if (dy < 0) {
-      shortest_distance = sqrt ((dx * dx) + (dy * dy));
-    } else {
-      shortest_distance = fabs (dx);
-    }
-  } else {
-    if (dy < 0) {
-      shortest_distance = fabs (dy);
-    } else {
-      shortest_distance = min (dx, dy);
-    }
-  }
-
-  return shortest_distance;
+  return sqrt ((dx * dx) + (dy * dy));
 }
 
 /*! \brief Set the string displayed by a text object.




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