Salome HOME
Increase selection area of point on 1
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_Angle.cpp
index 40133d9cb8124f1c7ce76cea27fd39cb68cf60df..1e35ac4701f089c30dd7a1496e5eb70186596f93 100644 (file)
@@ -82,10 +82,15 @@ void SketcherPrs_Angle::Compute(const Handle(PrsMgr_PresentationManager3d)& theP
   TopoDS_Edge aEdge2 = TopoDS::Edge(aTEdge2);
   SetMeasuredGeometry(aEdge1, aEdge2);
 
-  gp_Pnt aCenter = CenterPoint();
+  const gp_Pnt& aCenter = CenterPoint();
+  const gp_Pnt& aFirst = FirstPoint();
+  const gp_Pnt& aSecond = SecondPoint();
 
-  gp_Pnt aFLyPnt(aFlyoutPnt->x(), aFlyoutPnt->y(), aFlyoutPnt->z());
-  double aDist = aCenter.Distance(aFLyPnt);
+  gp_Dir aBisector((aFirst.XYZ() + aSecond.XYZ()) * 0.5 - aCenter.XYZ());
+
+  gp_Pnt aFlyPnt(aFlyoutPnt->x(), aFlyoutPnt->y(), aFlyoutPnt->z());
+  gp_XYZ aFlyDir = aFlyPnt.XYZ() - aCenter.XYZ();
+  double aDist = aFlyDir.Dot(aBisector.XYZ());
   SetFlyout(aDist);
 
   // Angle value is in degrees