From c1cdbd128ca2e383285eeff06a3ddc6ca55895e5 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 18 Sep 2003 11:35:32 +0000 Subject: [PATCH] clip region fix backported for fast port setter git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@23661 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/dc.cpp | 6 ++++++ src/mac/dc.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/mac/carbon/dc.cpp b/src/mac/carbon/dc.cpp index 1ad485e36f..aeded9e927 100644 --- a/src/mac/carbon/dc.cpp +++ b/src/mac/carbon/dc.cpp @@ -71,15 +71,21 @@ public : wxASSERT( dc->Ok() ) ; GetPort( &m_oldPort ) ; SetPort( (GrafPtr) dc->m_macPort ) ; + m_clipRgn = NewRgn() ; + GetClip( m_clipRgn ) ; m_dc = dc ; dc->MacSetupPort( NULL ) ; } ~wxMacFastPortSetter() { + SetPort( (GrafPtr) m_dc->m_macPort ) ; + SetClip( m_clipRgn ) ; SetPort( m_oldPort ) ; m_dc->MacCleanupPort( NULL ) ; + DisposeRgn( m_clipRgn ) ; } private : + RgnHandle m_clipRgn ; GrafPtr m_oldPort ; const wxDC* m_dc ; } ; diff --git a/src/mac/dc.cpp b/src/mac/dc.cpp index 1ad485e36f..aeded9e927 100644 --- a/src/mac/dc.cpp +++ b/src/mac/dc.cpp @@ -71,15 +71,21 @@ public : wxASSERT( dc->Ok() ) ; GetPort( &m_oldPort ) ; SetPort( (GrafPtr) dc->m_macPort ) ; + m_clipRgn = NewRgn() ; + GetClip( m_clipRgn ) ; m_dc = dc ; dc->MacSetupPort( NULL ) ; } ~wxMacFastPortSetter() { + SetPort( (GrafPtr) m_dc->m_macPort ) ; + SetClip( m_clipRgn ) ; SetPort( m_oldPort ) ; m_dc->MacCleanupPort( NULL ) ; + DisposeRgn( m_clipRgn ) ; } private : + RgnHandle m_clipRgn ; GrafPtr m_oldPort ; const wxDC* m_dc ; } ;