From 833e100f7ff356db8469721ae104b6b2177c0dae Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 20 Dec 2012 13:00:42 +0000 Subject: [PATCH] benefit from 10.5+ call HIShapeUnionWithRect git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/osx/carbon/region.h | 1 + src/osx/carbon/region.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/wx/osx/carbon/region.h b/include/wx/osx/carbon/region.h index 685c39de66..eec9be0037 100644 --- a/include/wx/osx/carbon/region.h +++ b/include/wx/osx/carbon/region.h @@ -55,6 +55,7 @@ protected: virtual bool DoOffset(wxCoord x, wxCoord y); virtual bool DoCombine(const wxRegion& region, wxRegionOp op); + virtual bool DoUnionWithRect(const wxRect& rect); private: DECLARE_DYNAMIC_CLASS(wxRegion) diff --git a/src/osx/carbon/region.cpp b/src/osx/carbon/region.cpp index 3819109367..28e78cf999 100644 --- a/src/osx/carbon/region.cpp +++ b/src/osx/carbon/region.cpp @@ -169,6 +169,21 @@ bool wxRegion::DoOffset(wxCoord x, wxCoord y) return true ; } +bool wxRegion::DoUnionWithRect(const wxRect& rect) +{ + if ( !m_refData ) + { + m_refData = new wxRegionRefData(rect.x , rect.y , rect.width , rect.height); + return true; + } + + AllocExclusive(); + + CGRect r = CGRectMake(rect.x , rect.y , rect.width , rect.height); + HIShapeUnionWithRect(M_REGION , &r); + + return true; +} //! Union /e region with this. bool wxRegion::DoCombine(const wxRegion& region, wxRegionOp op) -- 2.45.2