From fd5576a3262e6251d5d488c3fa0f37346293ac96 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 2 Jul 2018 20:50:44 +0200 Subject: [PATCH] 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. --- src/osx/carbon/graphics.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index 147e237e35..f3d6137ea1 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -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; }