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