From 80926f787b594a2e9b77ee5bd22f517bdb910f07 Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 15 Dec 2017 13:06:33 +0300 Subject: [PATCH] Issue #2361 sketch line color is wrong after delete and undo --- src/SketchPlugin/SketchPlugin_Projection.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 -- 2.39.2