summaryrefslogtreecommitdiff
path: root/src/region.cpp
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-07-25 11:46:58 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-07-25 11:46:58 +0800
commitffbb4529ae0e01d2a972cb03aefd25f3882fe37c (patch)
treed57699c87f4d0d7151ab9bcc9c7301b9e42e3fa8 /src/region.cpp
parentbc0fe4d28281863a1c075f17a3a4798a51389af7 (diff)
downloadunity-window-decorator-ffbb4529ae0e01d2a972cb03aefd25f3882fe37c.tar.gz
unity-window-decorator-ffbb4529ae0e01d2a972cb03aefd25f3882fe37c.tar.bz2
Add a constructor to initialize a CompRegion from a series of CompPoint's,
much like the XPolygonRegion construct allows for
Diffstat (limited to 'src/region.cpp')
-rw-r--r--src/region.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/region.cpp b/src/region.cpp
index 334be13..d2239d3 100644
--- a/src/region.cpp
+++ b/src/region.cpp
@@ -71,6 +71,16 @@ CompRegion::CompRegion (const CompRect &r)
priv->box.rects = &priv->box.extents;
}
+CompRegion::CompRegion (const CompPoint::vector &points)
+{
+ XPoint pts[points.size ()];
+ priv = new PrivateRegion ();
+ priv->region = XPolygonRegion (pts, points.size (), 1);
+ priv->box.extents = priv->region->extents;
+ priv->box.numRects = priv->region->numRects;
+ priv->box.rects = &priv->box.extents;
+}
+
CompRegion::~CompRegion ()
{
delete priv;