summaryrefslogtreecommitdiff
path: root/src/region.cpp
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2009-02-27 09:45:45 +0100
committerDanny Baumann <dannybaumann@web.de>2009-02-27 09:45:45 +0100
commit751bec057a73336f87391ae82049214ddd3a19bb (patch)
tree8ae2d2292a465e9f29c0a6ecb51b833368165cee /src/region.cpp
parent3154f5aac9c6e1f57ba7cc438477be4bcecb5b28 (diff)
downloadunity-window-decorator-751bec057a73336f87391ae82049214ddd3a19bb.tar.gz
unity-window-decorator-751bec057a73336f87391ae82049214ddd3a19bb.tar.bz2
Fix contains method and improve intersects method.
Diffstat (limited to 'src/region.cpp')
-rw-r--r--src/region.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/region.cpp b/src/region.cpp
index b3f6de8..7819728 100644
--- a/src/region.cpp
+++ b/src/region.cpp
@@ -133,8 +133,11 @@ CompRegion::contains (const CompPoint &p) const
bool
CompRegion::contains (const CompRect &r) const
{
- return XRectInRegion (handle (), r.x (), r.y (), r.width (), r.height ())
- != RectangleOut;
+ int result;
+
+ result = XRectInRegion (handle (), r.x (), r.y (), r.width (), r.height ());
+
+ return result == RectangleIn;
}
CompRegion
@@ -164,7 +167,10 @@ CompRegion::intersects (const CompRegion &r) const
bool
CompRegion::intersects (const CompRect &r) const
{
- return !intersected (r).isEmpty ();
+ int result;
+ result = XRectInRegion (handle (), r.x (), r.y (), r.width (), r.height ());
+
+ return result != RectangleOut;
}
bool