make sure invisible windows cannot paint using a wxClientDC or wxWindowDC by making their clip rect empty

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@53844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2008-05-30 16:42:09 +00:00
parent dee6abf6d4
commit a69994a545

View File

@@ -128,6 +128,9 @@ wxWindowDC::wxWindowDC(wxWindow *window)
#if wxMAC_USE_CORE_GRAPHICS
m_window->GetSize( &m_width , &m_height);
if ( !m_window->IsShownOnScreen() )
m_width = m_height = 0;
CGContextRef cg = (CGContextRef) window->MacGetCGContextRef();
m_release = false;
if ( cg == NULL )
@@ -246,6 +249,8 @@ wxClientDC::wxClientDC(wxWindow *window) :
wxCHECK_RET( window, _T("invalid window in wxClientDC") );
wxPoint origin = window->GetClientAreaOrigin() ;
m_window->GetClientSize( &m_width , &m_height);
if ( !m_window->IsShownOnScreen() )
m_width = m_height = 0;
SetDeviceOrigin( origin.x, origin.y );
SetClippingRegion( 0 , 0 , m_width , m_height ) ;
}