From: nds Date: Fri, 15 Dec 2017 10:06:33 +0000 (+0300) Subject: Issue #2361 sketch line color is wrong after delete and undo X-Git-Tag: V_2.10.0RC~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=80926f787b594a2e9b77ee5bd22f517bdb910f07;p=modules%2Fshaper.git Issue #2361 sketch line color is wrong after delete and undo --- diff --git a/src/SketchPlugin/SketchPlugin_Projection.cpp b/src/SketchPlugin/SketchPlugin_Projection.cpp index 198173850..e2095844a 100644 --- a/src/SketchPlugin/SketchPlugin_Projection.cpp +++ b/src/SketchPlugin/SketchPlugin_Projection.cpp @@ -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