diff --git a/src/msw/graphicsd2d.cpp b/src/msw/graphicsd2d.cpp index 8ecccb3f8e..76e4152987 100644 --- a/src/msw/graphicsd2d.cpp +++ b/src/msw/graphicsd2d.cpp @@ -1190,7 +1190,13 @@ void wxD2DPathData::AddLineToPoint(wxDouble x, wxDouble y) // adds a cubic Bezier curve from the current point, using two control points and an end point void wxD2DPathData::AddCurveToPoint(wxDouble cx1, wxDouble cy1, wxDouble cx2, wxDouble cy2, wxDouble x, wxDouble y) { - EnsureFigureOpen(m_currentPoint.x, m_currentPoint.y); + // If no current point is set then this function should behave + // as if preceded by a call to MoveToPoint(cx1, cy1). + if( m_currentPointSet ) + EnsureFigureOpen(m_currentPoint.x, m_currentPoint.y); + else + MoveToPoint(cx1, cy1); + D2D1_BEZIER_SEGMENT bezierSegment = { { (FLOAT)cx1, (FLOAT)cy1 }, { (FLOAT)cx2, (FLOAT)cy2 },