Explicitly return (0,0) if no current point is set for graphics path (macOS)
This is to suppress a harmless warning displayed in the console if CGPathGetCurrentPoint() is called when no current point is set.
This commit is contained in:
@@ -1240,7 +1240,15 @@ void wxMacCoreGraphicsPathData::CloseSubpath()
|
|||||||
// gets the last point of the current path, (0,0) if not yet set
|
// gets the last point of the current path, (0,0) if not yet set
|
||||||
void wxMacCoreGraphicsPathData::GetCurrentPoint( wxDouble* x, wxDouble* y) const
|
void wxMacCoreGraphicsPathData::GetCurrentPoint( wxDouble* x, wxDouble* y) const
|
||||||
{
|
{
|
||||||
CGPoint p = CGPathGetCurrentPoint( m_path );
|
CGPoint p;
|
||||||
|
if ( CGPathIsEmpty(m_path) )
|
||||||
|
{
|
||||||
|
p.x = p.y = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p = CGPathGetCurrentPoint(m_path);
|
||||||
|
}
|
||||||
*x = p.x;
|
*x = p.x;
|
||||||
*y = p.y;
|
*y = p.y;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user