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

@@ -1581,12 +1581,14 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd))
const bool isTopLevel = tlwParent == wxpeer;
wxRegion clearRgn;
if ( tlwParent->GetWindowStyle() & wxFRAME_SHAPED )
{
wxRegion rgn = tlwParent->GetShape();
if ( rgn.IsOk() )
{
if ( isTopLevel )
clearRgn = updateRgn;
int xoffset = 0, yoffset = 0;
wxRegion rgn = tlwParent->GetShape();
wxpeer->MacRootWindowToWindow( &xoffset, &yoffset );
rgn.Offset( xoffset, yoffset );
updateRgn.Intersect(rgn);
@@ -1598,6 +1600,7 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd))
clearRgn.Intersect(rgn);
}
}
}
wxpeer->GetUpdateRegion() = updateRgn;