Don't assert in wxOSX if a shaped window doesn't define a valid shape.

A window with wxFRAME_SHAPED style can still not defined any valid shape
actually, in which case wxFRAME_SHAPED should be just ignored.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76679 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-06-10 00:38:06 +00:00
parent 8755da66aa
commit 90c9afad59

View File

@@ -1582,20 +1582,23 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd))
wxRegion clearRgn;
if ( tlwParent->GetWindowStyle() & wxFRAME_SHAPED )
{
if ( isTopLevel )
clearRgn = updateRgn;
int xoffset = 0, yoffset = 0;
wxRegion rgn = tlwParent->GetShape();
wxpeer->MacRootWindowToWindow( &xoffset, &yoffset );
rgn.Offset( xoffset, yoffset );
updateRgn.Intersect(rgn);
if ( isTopLevel )
if ( rgn.IsOk() )
{
// Exclude the window shape from the region to be cleared below.
rgn.Xor(wxpeer->GetSize());
clearRgn.Intersect(rgn);
if ( isTopLevel )
clearRgn = updateRgn;
int xoffset = 0, yoffset = 0;
wxpeer->MacRootWindowToWindow( &xoffset, &yoffset );
rgn.Offset( xoffset, yoffset );
updateRgn.Intersect(rgn);
if ( isTopLevel )
{
// Exclude the window shape from the region to be cleared below.
rgn.Xor(wxpeer->GetSize());
clearRgn.Intersect(rgn);
}
}
}