]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomData/GeomData_Point2DArray.cpp
Salome HOME
Implement possibility to add a pole to B-spline
[modules/shaper.git] / src / GeomData / GeomData_Point2DArray.cpp
index 4f18c7f768fc54601bc6e6b3ed6afc20b224bfc7..198f91605772dc56eb2a31c40f86576e5b36ccb7 100644 (file)
@@ -77,8 +77,10 @@ void GeomData_Point2DArray::setSize(const int theSize)
   }
   else { // reset the old array
     if (aValuesSize) {
-      if (aValuesSize != myArray->Length()) { // old data is not keept, a new array is created
+      if (aValuesSize != myArray->Length()) { // old data is kept in the new array
         Handle(TColStd_HArray1OfReal) aNewArray = new TColStd_HArray1OfReal(0, aValuesSize - 1);
+        for (int anIndex = 0; anIndex < aValuesSize && anIndex <= myArray->Upper(); ++anIndex)
+          aNewArray->SetValue(anIndex, myArray->Value(anIndex));
         myArray->ChangeArray(aNewArray);
         owner()->data()->sendAttributeUpdated(this);
       }