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:
Artur Wieczorek
2016-05-08 19:07:57 +02:00
parent e7a526604c
commit 17e24fec73
2 changed files with 13 additions and 2 deletions

View File

@@ -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);
}