From 2b0abbe05a15767d4952f2a36b3e9df3bde15c3e Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 29 Dec 2014 13:06:50 +0300 Subject: [PATCH] An arc moving correction for dragging it by the center point. --- src/SketchPlugin/SketchPlugin_Arc.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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; } } -- 2.39.2