summaryrefslogtreecommitdiff
path: root/src/rect.cpp
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@compiz-fusion.org>2008-11-04 16:56:13 +0100
committerDennis kasprzyk <onestone@compiz-fusion.org>2008-11-04 16:56:13 +0100
commitb2805b64cff0db2d4d9b269f8f86ca26f81cef85 (patch)
tree9b3dad40d84c5ecb04cf33e6a907536efe7537de /src/rect.cpp
parenta13593fe0feef1bdb8062026b866508e718c88d1 (diff)
downloadunity-window-decorator-b2805b64cff0db2d4d9b269f8f86ca26f81cef85.tar.gz
unity-window-decorator-b2805b64cff0db2d4d9b269f8f86ca26f81cef85.tar.bz2
Provide XRectangle -> CompRect constructor.
Diffstat (limited to 'src/rect.cpp')
-rw-r--r--src/rect.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rect.cpp b/src/rect.cpp
index adf9409..38ea292 100644
--- a/src/rect.cpp
+++ b/src/rect.cpp
@@ -52,6 +52,16 @@ CompRect::CompRect (const CompRect& r)
mRegion.rects = &mRegion.extents;
}
+CompRect::CompRect (const XRectangle xr)
+{
+ mRegion.rects = &mRegion.extents;
+ mRegion.numRects = 1;
+ mRegion.extents.x1 = xr.x;
+ mRegion.extents.x2 = xr.x + xr.width;
+ mRegion.extents.y1 = xr.y;
+ mRegion.extents.y2 = xr.y + xr.height;
+}
+
const Region
CompRect::region () const
{