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:
Artur Wieczorek
2018-07-02 20:50:44 +02:00
parent 534b8840d2
commit fd5576a326

View File

@@ -1240,7 +1240,15 @@ void wxMacCoreGraphicsPathData::CloseSubpath()
// gets the last point of the current path, (0,0) if not yet set
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;
*y = p.y;
}