From: Stefan Csomor Date: Tue, 28 Jan 2003 08:24:38 +0000 (+0000) Subject: closer clipping X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1dd85cc3d6b86bb56c640d3989563dd24c6893bd closer clipping git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18977 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/dc.cpp b/src/mac/carbon/dc.cpp index 638a4f0d58..1d19d743cd 100644 --- a/src/mac/carbon/dc.cpp +++ b/src/mac/carbon/dc.cpp @@ -64,6 +64,9 @@ wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win ) if ( win ) { +#if 0 + // this clipping area was set to the parent window's drawing area, lead to problems + // with MacOSX controls drawing outside their wx' rectangle RgnHandle insidergn = NewRgn() ; int x = 0 , y = 0; wxWindow *parent = win->GetParent() ; @@ -77,6 +80,13 @@ wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win ) OffsetRgn( m_newClip , x , y ) ; SetClip( m_newClip ) ; DisposeRgn( insidergn ) ; +#endif + RgnHandle insidergn = NewRgn() ; + int x = 0 , y = 0; + win->MacWindowToRootWindow( &x,&y ) ; + CopyRgn( (RgnHandle) ((wxWindow*)win)->MacGetVisibleRegion().GetWXHRGN() , m_newClip ) ; + OffsetRgn( m_newClip , x , y ) ; + SetClip( m_newClip ) ; } } wxMacWindowClipper::~wxMacWindowClipper() diff --git a/src/mac/dc.cpp b/src/mac/dc.cpp index 638a4f0d58..1d19d743cd 100644 --- a/src/mac/dc.cpp +++ b/src/mac/dc.cpp @@ -64,6 +64,9 @@ wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win ) if ( win ) { +#if 0 + // this clipping area was set to the parent window's drawing area, lead to problems + // with MacOSX controls drawing outside their wx' rectangle RgnHandle insidergn = NewRgn() ; int x = 0 , y = 0; wxWindow *parent = win->GetParent() ; @@ -77,6 +80,13 @@ wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win ) OffsetRgn( m_newClip , x , y ) ; SetClip( m_newClip ) ; DisposeRgn( insidergn ) ; +#endif + RgnHandle insidergn = NewRgn() ; + int x = 0 , y = 0; + win->MacWindowToRootWindow( &x,&y ) ; + CopyRgn( (RgnHandle) ((wxWindow*)win)->MacGetVisibleRegion().GetWXHRGN() , m_newClip ) ; + OffsetRgn( m_newClip , x , y ) ; + SetClip( m_newClip ) ; } } wxMacWindowClipper::~wxMacWindowClipper()