No segmentation fault will be occured if two nodes are exactly overlap each other, AND they are connected.
authorhegyi
Tue, 20 Feb 2007 15:46:19 +0000
changeset 1898b69c54d5bf0
parent 188 c1c9fcf03e94
child 190 2cac5b936a2b
No segmentation fault will be occured if two nodes are exactly overlap each other, AND they are connected.
gdc-broken_edge.cc
     1.1 --- a/gdc-broken_edge.cc	Sat Feb 03 12:43:01 2007 +0000
     1.2 +++ b/gdc-broken_edge.cc	Tue Feb 20 15:46:19 2007 +0000
     1.3 @@ -93,7 +93,10 @@
     1.4    XY unit_vector_in_dir(head-center);
     1.5    double length=sqrt( unit_vector_in_dir.normSquare() );
     1.6  
     1.7 -  unit_vector_in_dir/=length;
     1.8 +  if(length!=0)
     1.9 +    {
    1.10 +      unit_vector_in_dir/=length;
    1.11 +    }
    1.12  
    1.13    // update the arrow
    1.14    drawArrow(unit_vector_in_dir);