# HG changeset patch # User alpar # Date 1113596761 0 # Node ID 4338e4280f678e8a2f543f2adaf1fe182e4b7403 # Parent 1581f961cfaa5246acd7e0efb23ad37fa14cc9bd Fix a bug that caused corrupt eps file if there are loops or identical node coordinates in the graph. diff -r 1581f961cfaa -r 4338e4280f67 src/lemon/graph_to_eps.h --- a/src/lemon/graph_to_eps.h Fri Apr 15 19:56:25 2005 +0000 +++ b/src/lemon/graph_to_eps.h Fri Apr 15 20:26:01 2005 +0000 @@ -809,8 +809,9 @@ sw-=_parEdgeDist; sw/=-2.0; xy dvec(_coords[g.target(*i)]-_coords[g.source(*i)]); - double l=sqrt(dvec.normSquare()); - xy d(dvec/l); + double l=sqrt(dvec.normSquare()); + ///\todo better 'epsilon' would be nice here. + xy d(dvec/max(l,1e-9)); xy m; // m=xy(_coords[g.target(*i)]+_coords[g.source(*i)])/2.0;