From 51ca7cdcd09bf152c67a41be7106f73e1e06cc38 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 23 Sep 2014 17:40:08 +0000 Subject: [PATCH] Enable these wxRegion constructor for x11 port git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77784 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/x11/region.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/x11/region.cpp b/src/x11/region.cpp index 618afd45f5..ee6e510984 100644 --- a/src/x11/region.cpp +++ b/src/x11/region.cpp @@ -83,9 +83,8 @@ void wxRegion::InitRect(wxCoord x, wxCoord y, wxCoord w, wxCoord h) XUnionRectWithRegion( &rect, M_REGIONDATA->m_region, M_REGIONDATA->m_region ); } -wxRegion::wxRegion( size_t WXUNUSED(n), const wxPoint *WXUNUSED(points), wxPolygonFillMode WXUNUSED(fillStyle) ) +wxRegion::wxRegion( size_t n, const wxPoint *points, wxPolygonFillMode fillStyle ) { -#if 0 XPoint *xpoints = new XPoint[n]; for ( size_t i = 0 ; i < n ; i++ ) { @@ -95,18 +94,10 @@ wxRegion::wxRegion( size_t WXUNUSED(n), const wxPoint *WXUNUSED(points), wxPolyg m_refData = new wxRegionRefData(); - Region* reg = gdk_region_polygon - ( - gdkpoints, - n, - fillStyle == wxWINDING_RULE ? GDK_WINDING_RULE - : GDK_EVEN_ODD_RULE - ); - - M_REGIONDATA->m_region = reg; - - delete [] xpoints; -#endif + if ( fillStyle == wxODDEVEN_RULE ) + M_REGIONDATA->m_region = XPolygonRegion(xpoints, n, EvenOddRule); + else if ( fillStyle == wxWINDING_RULE ) + M_REGIONDATA->m_region = XPolygonRegion(xpoints, n, WindingRule); } wxRegion::~wxRegion()