Fixed adding a Bezier curve to wxGraphicsPath with GDI+ 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). See #17526
This commit is contained in:
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user