Fixed adding a Bezier curve to wxGraphicsPath with Direct2D renderer.

When current point is not set before the call to wxGraphicsPath::AddCurveToPoint() then it should be set at first control point prior to adding a curve (function should behave as if preceded by MoveToPoint).

Closes #17526
This commit is contained in:
Artur Wieczorek
2016-05-09 18:41:16 +02:00
parent 22c520e3e8
commit 66e3a3f724

View File

@@ -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 },