Salome HOME
Fix problems discovered by model tests
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintTangent.cpp
index 2551c2074ca5bcf71eff20ef3e72746a5906109d..1bf442634e914bc9286a85af8290a96adf060f4b 100644 (file)
@@ -26,13 +26,14 @@ static bool hasSingleCoincidence(FeaturePtr theFeature1, FeaturePtr theFeature2)
     if (aRef && aRef->getKind() == SketchPlugin_ConstraintCoincidence::ID())
       aCoincidences.insert(aRef);
   }
+  int aNbCoinCidentPoints = 0;
   for (anIt = aRefs2.begin(); anIt != aRefs2.end(); ++anIt) {
     FeaturePtr aRef = ModelAPI_Feature::feature((*anIt)->owner());
-    if (aRef)
-      aCoincidences.erase(aRef);
+    if (aCoincidences.find(aRef) != aCoincidences.end())
+      ++aNbCoinCidentPoints;
   }
 
-  return aCoincidences.size() <= 1;
+  return aNbCoinCidentPoints <= 1;
 }
 
 void SketchSolver_ConstraintTangent::getAttributes(