[Lemon-commits] [lemon_svn] alpar: r1805 - hugo/trunk/src/lemon

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:47:50 CET 2006


Author: alpar
Date: Fri Apr 15 22:26:01 2005
New Revision: 1805

Modified:
   hugo/trunk/src/lemon/graph_to_eps.h

Log:
Fix a bug that caused corrupt eps file if there are loops or identical
node coordinates in the graph.

Modified: hugo/trunk/src/lemon/graph_to_eps.h
==============================================================================
--- hugo/trunk/src/lemon/graph_to_eps.h	(original)
+++ hugo/trunk/src/lemon/graph_to_eps.h	Fri Apr 15 22:26:01 2005
@@ -809,8 +809,9 @@
 	  sw-=_parEdgeDist;
 	  sw/=-2.0;
 	  xy<double> dvec(_coords[g.target(*i)]-_coords[g.source(*i)]);
-	  double l=sqrt(dvec.normSquare());
-	  xy<double> d(dvec/l);
+	  double l=sqrt(dvec.normSquare()); 
+	  ///\todo better 'epsilon' would be nice here.
+	  xy<double> d(dvec/max(l,1e-9));
  	  xy<double> m;
 // 	  m=xy<double>(_coords[g.target(*i)]+_coords[g.source(*i)])/2.0;
 



More information about the Lemon-commits mailing list