From: azv Date: Mon, 5 Dec 2016 10:16:43 +0000 (+0300) Subject: Fix because of Angle unit test failed X-Git-Tag: V_2.6.0~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=305116b958ad7eb39d044ba14f5103c9d138853e;p=modules%2Fshaper.git Fix because of Angle unit test failed --- diff --git a/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp b/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp index 9743e6511..108818439 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp @@ -149,10 +149,16 @@ void SketchPlugin_ConstraintAngle::attributeChanged(const std::string& theID) myFlyoutUpdate = false; } else if (theID == SketchPlugin_ConstraintAngle::TYPE_ID()) { - double anAngle = calculateAngle(); std::shared_ptr aValueAttr = std::dynamic_pointer_cast< - ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_ConstraintAngle::VALUE())); - aValueAttr->setValue(anAngle); + ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID())); + double anAngle = calculateAngle(); + if (aValueAttr->text().empty()) + aValueAttr->setValue(anAngle); + else { + aValueAttr = std::dynamic_pointer_cast< + ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_ConstraintAngle::VALUE())); + aValueAttr->setValue(anAngle); + } } else if (theID == SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID()) { updateConstraintValueByAngleValue();