Fix AddLineToPoint() if no current point is set (macOS)

AddLineToPoint() should behave as MoveToPoint() if there is no current point.

See #18111.
This commit is contained in:
Artur Wieczorek
2018-07-02 20:32:29 +02:00
parent f258dc4c64
commit 8349c4bf7f

View File

@@ -1163,9 +1163,18 @@ void wxMacCoreGraphicsPathData::MoveToPoint( wxDouble x1 , wxDouble y1 )
}
void wxMacCoreGraphicsPathData::AddLineToPoint( wxDouble x1 , wxDouble y1 )
{
// This function should behave as MoveToPoint if current point is not yet set
// (CGPathAddLineToPoint requires non-empty path).
if ( CGPathIsEmpty(m_path) )
{
MoveToPoint(x1, y1);
}
else
{
CGPathAddLineToPoint( m_path , NULL , (CGFloat) x1 , (CGFloat) y1 );
}
}
void wxMacCoreGraphicsPathData::AddCurveToPoint( wxDouble cx1, wxDouble cy1, wxDouble cx2, wxDouble cy2, wxDouble x, wxDouble y )
{