]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2361 sketch line color is wrong after delete and undo
authornds <nds@opencascade.com>
Fri, 15 Dec 2017 10:06:33 +0000 (13:06 +0300)
committernds <nds@opencascade.com>
Fri, 15 Dec 2017 10:06:33 +0000 (13:06 +0300)
src/SketchPlugin/SketchPlugin_Projection.cpp

index 1981738505a0213ab9350ba4701f6598f3f229ee..e2095844a0def8cb81a0b8c0090d8aff1110e96e 100644 (file)
@@ -75,14 +75,17 @@ void SketchPlugin_Projection::execute()
     return;
   FeaturePtr aProjection = ModelAPI_Feature::feature(aRefAttr->object());
 
-  if (!lastResult().get() && aProjection->lastResult().get()) {
+  if (!lastResult().get()) {
+    bool hasProjResult = aProjection->lastResult().get();
     ResultConstructionPtr aConstr = document()->createConstruction(data());
-    aConstr->setShape(aProjection->lastResult()->shape());
+    if (hasProjResult)
+      aConstr->setShape(aProjection->lastResult()->shape());
     aConstr->setIsInHistory(false);
     aConstr->setDisplayed(false);
     setResult(aConstr);
 
-    aProjection->selection(EXTERNAL_ID())->setValue(lastResult(), lastResult()->shape());
+    if (hasProjResult)
+      aProjection->selection(EXTERNAL_ID())->setValue(lastResult(), lastResult()->shape());
   }
 
   // is sketch plane is changed (issue 1791), attribute of projection is not changed, but