Fix retrieving empty bounding box for Core Graphics graphics path
Return "zero" rectangle if bounding box is empty
This commit is contained in:
parent
c8fe811636
commit
c948e1e15e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user