Fix AddCurveToPoint and AddQuadCurveToPoint if no current point is set (macOS)
If current point is not yet set, these functions should behave as if they were preceded by a call to MoveToPoint(cx1, cy1). Closes #18111.
This commit is contained in:
@@ -1178,11 +1178,23 @@ void wxMacCoreGraphicsPathData::AddLineToPoint( wxDouble x1 , wxDouble y1 )
|
||||
|
||||
void wxMacCoreGraphicsPathData::AddCurveToPoint( wxDouble cx1, wxDouble cy1, wxDouble cx2, wxDouble cy2, wxDouble x, wxDouble y )
|
||||
{
|
||||
// This function should be preceded by MoveToPoint(cx1, cy1)
|
||||
// if current point is not yet set (CGPathAddCurveToPoint requires non-empty path).
|
||||
if ( CGPathIsEmpty(m_path) )
|
||||
{
|
||||
MoveToPoint(cx1, cy1);
|
||||
}
|
||||
CGPathAddCurveToPoint( m_path , NULL , (CGFloat) cx1 , (CGFloat) cy1 , (CGFloat) cx2, (CGFloat) cy2, (CGFloat) x , (CGFloat) y );
|
||||
}
|
||||
|
||||
void wxMacCoreGraphicsPathData::AddQuadCurveToPoint( wxDouble cx1, wxDouble cy1, wxDouble x, wxDouble y )
|
||||
{
|
||||
// This function should be preceded by MoveToPoint(cx1, cy1)
|
||||
// if current point is not yet set (CGPathAddQuadCurveToPoint requires non-empty path).
|
||||
if ( CGPathIsEmpty(m_path) )
|
||||
{
|
||||
MoveToPoint(cx1, cy1);
|
||||
}
|
||||
CGPathAddQuadCurveToPoint( m_path , NULL , (CGFloat) cx1 , (CGFloat) cy1 , (CGFloat) x , (CGFloat) y );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user