X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2a365b7d3f8598b0c7d98a150c47f0211d27437e..636d266b8993dd831aa47bdd7e673be32166b54a:/src/gtk/region.cpp?ds=sidebyside diff --git a/src/gtk/region.cpp b/src/gtk/region.cpp index e4d59dc1e8..b89afd3b4c 100644 --- a/src/gtk/region.cpp +++ b/src/gtk/region.cpp @@ -186,6 +186,30 @@ wxRegion::wxRegion( const wxRect& rect ) #endif } +wxRegion::wxRegion( size_t n, const wxPoint *points, int fillStyle ) +{ + GdkPoint *gdkpoints = new GdkPoint[n]; + for ( size_t i = 0 ; i < n ; i++ ) + { + gdkpoints[i].x = points[i].x; + gdkpoints[i].y = points[i].y; + } + + m_refData = new wxRegionRefData(); + + GdkRegion* reg = gdk_region_polygon + ( + gdkpoints, + n, + fillStyle == wxWINDING_RULE ? GDK_WINDING_RULE + : GDK_EVEN_ODD_RULE + ); + + M_REGIONDATA->m_region = reg; + + delete [] gdkpoints; +} + wxRegion::~wxRegion() { } @@ -766,10 +790,8 @@ wxCoord wxRegionIterator::GetH() const wxRect wxRegionIterator::GetRect() const { wxRect r; - wxNode *node = m_region.GetRectList()->Nth( m_current ); - - if (node) - r = *((wxRect*)node->Data()); + if( HaveRects() ) + r = ((wxRIRefData*)m_refData)->m_rects[m_current]; return r; }