From c948e1e15ed59e8859968c87d9956b6fddaa0ba9 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 28 Jul 2018 11:48:21 +0200 Subject: [PATCH] Fix retrieving empty bounding box for Core Graphics graphics path Return "zero" rectangle if bounding box is empty --- src/osx/carbon/graphics.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index cf292a26e4..01a54e106a 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -1272,6 +1272,11 @@ void wxMacCoreGraphicsPathData::Transform( const wxGraphicsMatrixData* matrix ) void wxMacCoreGraphicsPathData::GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h) const { CGRect bounds = CGPathGetBoundingBox( m_path ) ; + if ( CGRectIsEmpty(bounds) ) + { + bounds = CGRectZero; + } + *x = bounds.origin.x; *y = bounds.origin.y; *w = bounds.size.width;