]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix regressions found by unit tests
authorazv <azv@opencascade.com>
Tue, 23 May 2017 12:10:52 +0000 (15:10 +0300)
committerazv <azv@opencascade.com>
Tue, 23 May 2017 12:10:52 +0000 (15:10 +0300)
src/SketchSolver/SketchSolver_ConstraintCollinear.cpp
src/SketchSolver/SketchSolver_ConstraintMiddle.cpp

index d084f8b7d96eeb28fb5204a60ac94b5ba71ca96a..4ca4b2a0e8874bc1c22bddc75ae6034ab9a6de9d 100644 (file)
@@ -62,7 +62,7 @@ void SketchSolver_ConstraintCollinear::process()
 void SketchSolver_ConstraintCollinear::notify(const FeaturePtr&      theFeature,
                                               PlaneGCSSolver_Update* theUpdater)
 {
-  if (theFeature == myBaseConstraint)
+  if (theFeature == myBaseConstraint && myInSolver)
     return; // the constraint is already being updated
 
   PlaneGCSSolver_UpdateCoincidence* anUpdater =
index 2a1c1c421079065910f621727c88fdb5a78a9da4..92f274986a3795a15695c0f29fd18175226ff7c7 100644 (file)
@@ -14,7 +14,7 @@ void SketchSolver_ConstraintMiddle::getAttributes(
 void SketchSolver_ConstraintMiddle::notify(const FeaturePtr&      theFeature,
                                            PlaneGCSSolver_Update* theUpdater)
 {
-  if (theFeature == myBaseConstraint)
+  if (theFeature == myBaseConstraint && myInSolver)
     return; // the constraint is already being updated
 
   PlaneGCSSolver_UpdateCoincidence* anUpdater =
@@ -45,8 +45,8 @@ void SketchSolver_ConstraintMiddle::notify(const FeaturePtr&      theFeature,
     }
   } else {
     if (myInSolver) {
-      myInSolver = false;
       myStorage->removeConstraint(myBaseConstraint);
+      myInSolver = false;
     }
 
     if (!myMiddle) {