Fixed adding a line to wxGraphicsPath with GDI+ renderer.
When current point is not yet set then wxGraphicsPath::AddLineToPoint() should behave as MoveToPoint(). See #17525
This commit is contained in:
@@ -79,10 +79,14 @@ public:
|
||||
|
||||
/**
|
||||
Adds a straight line from the current point to (@a x,@a y).
|
||||
If current point is not yet set before the call to AddLineToPoint()
|
||||
this function will behave as MoveToPoint().
|
||||
*/
|
||||
virtual void AddLineToPoint(wxDouble x, wxDouble y);
|
||||
/**
|
||||
Adds a straight line from the current point to @a p.
|
||||
If current point is not yet set before the call to AddLineToPoint()
|
||||
this function will behave as MoveToPoint().
|
||||
*/
|
||||
void AddLineToPoint(const wxPoint2DDouble& p);
|
||||
|
||||
|
||||
@@ -1220,7 +1220,14 @@ void wxGDIPlusPathData::AddLineToPoint( wxDouble x , wxDouble y )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_path->GetLastPoint(&start);
|
||||
Status st = m_path->GetLastPoint(&start);
|
||||
// If current point is not yet set then
|
||||
// this function should behave as MoveToPoint.
|
||||
if ( st != Ok )
|
||||
{
|
||||
MoveToPoint(x, y);
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_path->AddLine(start.X, start.Y, (REAL)x, (REAL)y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user