X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/29149a64916d6fdc53e445adca9ef83bc58fb6c3..5d6c4365363f84bf587c7f5f916e5830ef8a11e3:/src/gtk1/region.cpp?ds=sidebyside diff --git a/src/gtk1/region.cpp b/src/gtk1/region.cpp index 5c11a0acf3..b89afd3b4c 100644 --- a/src/gtk1/region.cpp +++ b/src/gtk1/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() { } @@ -351,6 +375,7 @@ bool wxRegion::Intersect( const wxRegion& region ) } // we need to update the rect list as well +#if OLDCODE wxList& list = *GetRectList(); wxNode *node = list.First(); while (node) @@ -372,7 +397,7 @@ bool wxRegion::Intersect( const wxRegion& region ) node = node->Next(); } - +#endif return TRUE; } @@ -765,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; }