summaryrefslogtreecommitdiff
path: root/src/region.cpp
diff options
context:
space:
mode:
authorEduardo Gurgel Pinho <eduardo@mad4.Chagas>2009-03-06 23:02:39 -0300
committerDennis Kasprzyk <onestone@compiz-fusion.org>2009-03-10 00:34:19 +0100
commit39c08a74883bcb639cab9c86ae2ba0c63433c036 (patch)
treec286b7acfca8750d1c31ac72f219a3443e900ddd /src/region.cpp
parent5041f18da51155345debabcbe8232591eb2220c8 (diff)
downloadunity-window-decorator-39c08a74883bcb639cab9c86ae2ba0c63433c036.tar.gz
unity-window-decorator-39c08a74883bcb639cab9c86ae2ba0c63433c036.tar.bz2
Applying CompRect changes
Diffstat (limited to 'src/region.cpp')
-rw-r--r--src/region.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/region.cpp b/src/region.cpp
index 7819728..4200cac 100644
--- a/src/region.cpp
+++ b/src/region.cpp
@@ -33,8 +33,8 @@
#include "privateregion.h"
-const CompRegion infiniteRegion (CompRect (MINSHORT, MAXSHORT,
- MINSHORT, MAXSHORT));
+const CompRegion infiniteRegion (CompRect (MINSHORT, MINSHORT,
+ MAXSHORT * 2, MAXSHORT * 2));
const CompRegion emptyRegion;
CompRegion::CompRegion ()
@@ -58,7 +58,7 @@ CompRegion::CompRegion (const CompRegion &c)
CompRegion::CompRegion ( int x, int y, int w, int h)
{
priv = new PrivateRegion ();
- priv->box.extents = CompRect (x, x + w, y, y + h).region ()->extents;
+ priv->box.extents = CompRect (x, y, w, h).region ()->extents;
priv->box.numRects = 1;
priv->box.rects = &priv->box.extents;
}
@@ -121,7 +121,7 @@ CompRect
CompRegion::boundingRect () const
{
BOX b = handle ()->extents;
- return CompRect (b.x1, b.x2, b.y1, b.y2);
+ return CompRect (b.x1, b.y1, b.x2 - b.x1, b.y2 - b.y1);
}
bool
@@ -193,8 +193,10 @@ CompRegion::rects () const
return rv;
if (!priv->region)
{
- rv.push_back (CompRect (priv->box.extents.x1, priv->box.extents.x2,
- priv->box.extents.y1, priv->box.extents.y2));
+ rv.push_back (CompRect (priv->box.extents.x1,
+ priv->box.extents.y1,
+ priv->box.extents.x2 - priv->box.extents.x1,
+ priv->box.extents.y2 - priv->box.extents.y1));
return rv;
}
@@ -202,7 +204,7 @@ CompRegion::rects () const
for (int i = 0; i < priv->region->numRects; i++)
{
b = priv->region->rects[i];
- rv.push_back (CompRect (b.x1, b.x2, b.y1, b.y2));
+ rv.push_back (CompRect (b.x1, b.y1, b.x2 - b.x1, b.y2 - b.y1));
}
return rv;
}