From: nds Date: Mon, 29 Dec 2014 10:06:50 +0000 (+0300) Subject: An arc moving correction for dragging it by the center point. X-Git-Tag: V_0.7.0_rc1~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2b0abbe05a15767d4952f2a36b3e9df3bde15c3e;p=modules%2Fshaper.git An arc moving correction for dragging it by the center point. --- diff --git a/src/SketchPlugin/SketchPlugin_Arc.cpp b/src/SketchPlugin/SketchPlugin_Arc.cpp index d6a6facfa..3acdb0e31 100644 --- a/src/SketchPlugin/SketchPlugin_Arc.cpp +++ b/src/SketchPlugin/SketchPlugin_Arc.cpp @@ -237,5 +237,14 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID) if (aProjection && aStartAttr->pnt()->distance(aProjection) > tolerance) aStartAttr->setValue(aProjection); myStartUpdate = false; + } else if (theID == CENTER_ID() && !myEndUpdate) { + myEndUpdate = true; + // compute and change the arc end point + std::shared_ptr aCircleForArc( + new GeomAPI_Circ2d(aCenterAttr->pnt(), aStartAttr->pnt())); + std::shared_ptr aProjection = aCircleForArc->project(anEndAttr->pnt()); + if (aProjection && anEndAttr->pnt()->distance(aProjection) > tolerance) + anEndAttr->setValue(aProjection); + myEndUpdate = false; } }