]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix jumping of a circle built by three points
authorazv <azv@opencascade.com>
Mon, 3 Apr 2017 11:56:29 +0000 (14:56 +0300)
committerazv <azv@opencascade.com>
Mon, 3 Apr 2017 11:56:29 +0000 (14:56 +0300)
src/SketchPlugin/SketchPlugin_MacroCircle.cpp

index b14bc1420c0a5c00e7bf443880aad79a10b0d7f5..e0c178ddd78f70f2a940676330d8b2a8bbd3e132 100644 (file)
@@ -256,15 +256,15 @@ void SketchPlugin_MacroCircle::fillByThreePoints()
 
     if (aPassedPoint)
       aCircBuilder.addPassingPoint(aPassedPoint);
-    else
+    else {
       aCircBuilder.addTangentCurve(aTangentCurve);
+      AttributePoint2DPtr aPassedPoint =
+          std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aPassedAttr);
+      if (aPassedPoint)
+        aCircBuilder.setClosestPoint(aPassedPoint->pnt());
+    }
   }
 
-  AttributePoint2DPtr aThirdPoint =
-      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(attribute(THIRD_POINT_ID()));
-  if (aThirdPoint)
-    aCircBuilder.setClosestPoint(aThirdPoint->pnt());
-
   std::shared_ptr<GeomAPI_Circ2d> aCircle = aCircBuilder.circle();
   if (aCircle) {
     myCenter = aCircle->center();