From b1aaf3f2c1e104a8061be25a0d8591a1b8c6ca7a Mon Sep 17 00:00:00 2001 From: azv Date: Tue, 23 May 2017 15:10:52 +0300 Subject: [PATCH] Fix regressions found by unit tests --- src/SketchSolver/SketchSolver_ConstraintCollinear.cpp | 2 +- src/SketchSolver/SketchSolver_ConstraintMiddle.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SketchSolver/SketchSolver_ConstraintCollinear.cpp b/src/SketchSolver/SketchSolver_ConstraintCollinear.cpp index d084f8b7d..4ca4b2a0e 100644 --- a/src/SketchSolver/SketchSolver_ConstraintCollinear.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintCollinear.cpp @@ -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 = diff --git a/src/SketchSolver/SketchSolver_ConstraintMiddle.cpp b/src/SketchSolver/SketchSolver_ConstraintMiddle.cpp index 2a1c1c421..92f274986 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMiddle.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMiddle.cpp @@ -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) { -- 2.39.2