diff --git a/docs/doxygen/images/drawing-addarctopoint.png b/docs/doxygen/images/drawing-addarctopoint.png new file mode 100644 index 0000000000..e3aa71932a Binary files /dev/null and b/docs/doxygen/images/drawing-addarctopoint.png differ diff --git a/interface/wx/graphics.h b/interface/wx/graphics.h index 792821e61d..7361413c4b 100644 --- a/interface/wx/graphics.h +++ b/interface/wx/graphics.h @@ -50,9 +50,14 @@ public: //@} /** - Appends a an arc to two tangents connecting (current) to (@a x1,@a y1) - and (@a x1,@a y1) to (@a x2,@a y2), also a straight line from (current) - to (@a x1,@a y1). + Adds an arc (of a circle with radius @a r) that is tangent + to the line connecting current point and (@a x1, @a y1) and + to the line connecting (@a x1, @a y1) and (@a x2, @a y2). + If the current point and the starting point of the arc are different, + a straight line connecting these points is also appended. + After this call the current point will be at the ending point + of the arc. + @image html drawing-addarctopoint.png */ virtual void AddArcToPoint(wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, wxDouble r); diff --git a/src/common/graphcmn.cpp b/src/common/graphcmn.cpp index a48d03c37d..3d70b9a202 100644 --- a/src/common/graphcmn.cpp +++ b/src/common/graphcmn.cpp @@ -479,7 +479,6 @@ void wxGraphicsPathData::AddArcToPoint( wxDouble x1, wxDouble y1 , wxDouble x2, alpha == 0 || alpha == 180 || r == 0 ) { AddLineToPoint(p1.m_x, p1.m_y); - AddLineToPoint(p2.m_x, p2.m_y); return; } @@ -489,8 +488,6 @@ void wxGraphicsPathData::AddArcToPoint( wxDouble x1, wxDouble y1 , wxDouble x2, alpha = wxDegToRad(alpha); wxDouble distT = r / sin(alpha) * (1.0 + cos(alpha)); // = r / tan(a/2) = r / sin(a/2) * cos(a/2) wxDouble distC = r / sin(alpha / 2.0); - wxASSERT_MSG( distT <= v1Length && distT <= v2Length, - wxS("Radius is too big to fit the arc to given points") ); // Calculate tangential points v1.Normalize(); v2.Normalize(); @@ -513,7 +510,6 @@ void wxGraphicsPathData::AddArcToPoint( wxDouble x1, wxDouble y1 , wxDouble x2, AddLineToPoint(t1.m_x, t1.m_y); AddArc(c.m_x, c.m_y, r, wxDegToRad(a1), wxDegToRad(a2), drawClockwiseArc); - AddLineToPoint(p2.m_x, p2.m_y); } //-----------------------------------------------------------------------------