added support for polygons to wxRegion

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-08-27 14:56:55 +00:00
parent 673f4220ba
commit 5549e9f76f
8 changed files with 159 additions and 80 deletions

View File

@@ -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()
{
}