Salome HOME
Merge remote-tracking branch 'origin/master' into gni/documentation
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintMirror.cpp
index a8eb3d6c437facaeae818e0f32dabb3e872d8603..009e9ab448eeeee7116026f4797f1ebfe976debd 100644 (file)
@@ -62,6 +62,11 @@ void SketchPlugin_ConstraintMirror::execute()
   if (isUpdateFlushed)
     Events_Loop::loop()->setFlushed(anUpdateEvent, false);
 
+  // Save the current feature of the document, because new features may appear while executing.
+  // In this case, they will become current. But if the number of copies is updated from outside
+  // of sketch (e.g. by parameter change), the history line should not hold in sketch.
+  keepCurrentFeature();
+
   std::shared_ptr<ModelAPI_Data> aData = data();
   AttributeRefListPtr aRefListOfShapes = std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(
       aData->attribute(SketchPlugin_Constraint::ENTITY_B()));
@@ -198,6 +203,8 @@ void SketchPlugin_ConstraintMirror::execute()
     }
   }
 
+  restoreCurrentFeature();
+
   // send events to update the sub-features by the solver
   if (isUpdateFlushed)
     Events_Loop::loop()->setFlushed(anUpdateEvent, true);