diff --git a/interface/wx/graphics.h b/interface/wx/graphics.h index a6eef918fd..ec6bfa7200 100644 --- a/interface/wx/graphics.h +++ b/interface/wx/graphics.h @@ -58,6 +58,9 @@ public: /** Adds a cubic bezier curve from the current point, using two control points and an end point. + If there is no current point before the call to AddCurveToPoint() this + function will behave as if preceded by a call to + MoveToPoint(@a cx1, @a cy1). */ virtual void AddCurveToPoint(wxDouble cx1, wxDouble cy1, wxDouble cx2, wxDouble cy2, @@ -65,6 +68,8 @@ public: /** Adds a cubic bezier curve from the current point, using two control points and an end point. + If there is no current point before the call to AddCurveToPoint() this + function will behave as if preceded by a call to MoveToPoint(@a c1). */ void AddCurveToPoint(const wxPoint2DDouble& c1, const wxPoint2DDouble& c2, @@ -98,6 +103,9 @@ public: /** Adds a quadratic bezier curve from the current point, using a control point and an end point. + If there is no current point before the call to AddQuadCurveToPoint() + this function will behave as if preceded by a call to + MoveToPoint(@a cx, @a cy). */ virtual void AddQuadCurveToPoint(wxDouble cx, wxDouble cy, wxDouble x, wxDouble y); diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index 79a0dde0ed..db7037457a 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -1255,6 +1255,8 @@ void wxGDIPlusPathData::AddCurveToPoint( wxDouble cx1, wxDouble cy1, wxDouble cx PointF c2(cx2,cy2); PointF end(x,y); PointF start; + // If no current point is set then this function should behave + // as if preceded by a call to MoveToPoint(cx1, cy1). if ( m_logCurrentPointSet ) { start = m_logCurrentPoint; @@ -1264,7 +1266,11 @@ void wxGDIPlusPathData::AddCurveToPoint( wxDouble cx1, wxDouble cy1, wxDouble cx } else { - m_path->GetLastPoint(&start); + if( m_path->GetLastPoint(&start) != Ok ) + { + MoveToPoint(cx1, cy1); + start = c1; + } } m_path->AddBezier(start,c1,c2,end); }