Fix retrieving empty bounding box for Core Graphics graphics path
Return "zero" rectangle if bounding box is empty
This commit is contained in:
@@ -1272,6 +1272,11 @@ void wxMacCoreGraphicsPathData::Transform( const wxGraphicsMatrixData* matrix )
|
|||||||
void wxMacCoreGraphicsPathData::GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h) const
|
void wxMacCoreGraphicsPathData::GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h) const
|
||||||
{
|
{
|
||||||
CGRect bounds = CGPathGetBoundingBox( m_path ) ;
|
CGRect bounds = CGPathGetBoundingBox( m_path ) ;
|
||||||
|
if ( CGRectIsEmpty(bounds) )
|
||||||
|
{
|
||||||
|
bounds = CGRectZero;
|
||||||
|
}
|
||||||
|
|
||||||
*x = bounds.origin.x;
|
*x = bounds.origin.x;
|
||||||
*y = bounds.origin.y;
|
*y = bounds.origin.y;
|
||||||
*w = bounds.size.width;
|
*w = bounds.size.width;
|
||||||
|
Reference in New Issue
Block a user