Fix retrieving empty bounding box for Core Graphics graphics path

Return "zero" rectangle if bounding box is empty
This commit is contained in:
Artur Wieczorek 2018-07-28 11:48:21 +02:00
parent c8fe811636
commit c948e1e15e

View File

@ -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;