Salome HOME
Merge branch 'master' of https://codev-tuleap.cea.fr/plugins/git/salome/shaper
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Feature.cpp
index 9663e22c5db4c0bd23129bc759cae82ba2dc24aa..e006d6c6de5b8afca5f8271ef7dba420ef527b5f 100644 (file)
@@ -62,7 +62,10 @@ void SketchPlugin_Feature::keepCurrentFeature()
   FeaturePtr aCurFeature = document()->currentFeature(true);
   std::shared_ptr<SketchPlugin_Feature> aSketchFeature =
       std::dynamic_pointer_cast<SketchPlugin_Feature>(aCurFeature);
-  if (!aSketchFeature || aSketchFeature->sketch() == sketch())
+  std::shared_ptr<SketchPlugin_Sketch> aSketch =
+      std::dynamic_pointer_cast<SketchPlugin_Sketch>(aCurFeature);
+  if ((!aSketchFeature || aSketchFeature->sketch() != sketch()) &&
+      (!aSketch || aSketch.get() != sketch()))
     myCurrentFeature = aCurFeature;
 }