Salome HOME
PLEIADES. fix WrapperIndex(index) for negative index
authoreap <eap@opencascade.com>
Thu, 3 Aug 2006 05:59:03 +0000 (05:59 +0000)
committereap <eap@opencascade.com>
Thu, 3 Aug 2006 05:59:03 +0000 (05:59 +0000)
src/SMDS/SMDS_MeshElement.hxx

index 7fdd180bbd738f6ee94822f284accfa4300d53c1..54f5067726fdcbe0629e1f374b25643ffcf9847f 100644 (file)
@@ -103,7 +103,7 @@ public:
     * \retval int - valid node index
    */
   int WrappedIndex(const int ind) const {
-    if ( ind < 0 ) return -( ind % NbNodes());
+    if ( ind < 0 ) return NbNodes() + ind % NbNodes();
     if ( ind >= NbNodes() ) return ind % NbNodes();
     return ind;
   }