]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Get distance from polyline corrected (Bug #190).
authoradv <adv@opencascade.com>
Fri, 6 Dec 2013 07:17:13 +0000 (07:17 +0000)
committeradv <adv@opencascade.com>
Fri, 6 Dec 2013 07:17:13 +0000 (07:17 +0000)
src/HYDROData/HYDROData_PolylineXY.cxx

index a8cb4c0f7c3e837ac5e3e2f5eeed23579e76f7d7..6c7e591094f4cfd99e333444f5638dbd655d5160 100755 (executable)
@@ -296,6 +296,9 @@ double HYDROData_PolylineXY::GetDistance( const int theSectionIndex,
       const Point& aSectPoint = aSectPointsList.Value( i );
       aResDistance += gp_Pnt2d( aPrevPoint ).Distance( aSectPoint );
       aPrevPoint = aSectPoint;
+
+      if ( thePointIndex == i - 1 )
+        break;
     }
   }
   else