summaryrefslogtreecommitdiff
path: root/src/rect.cpp
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2009-03-14 09:11:11 +0100
committerDanny Baumann <dannybaumann@web.de>2009-03-14 09:11:11 +0100
commit90b5d264ee1f7f07ace330de91f6e8f7edb31f71 (patch)
treecb2a262ee70d92dd33296b548b0f15160ec514e6 /src/rect.cpp
parent3a19ffb33598e097cb3b8a2d79e319249a0def2f (diff)
downloadunity-window-decorator-90b5d264ee1f7f07ace330de91f6e8f7edb31f71.tar.gz
unity-window-decorator-90b5d264ee1f7f07ace330de91f6e8f7edb31f71.tar.bz2
Moving the rectangle origin should not change its size.
Diffstat (limited to 'src/rect.cpp')
-rw-r--r--src/rect.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rect.cpp b/src/rect.cpp
index 53cd960..6adf10f 100644
--- a/src/rect.cpp
+++ b/src/rect.cpp
@@ -83,20 +83,26 @@ CompRect::setGeometry (int x,
void
CompRect::setX (int x)
{
+ int width = mRegion.extents.x2 - mRegion.extents.x1;
+
mRegion.extents.x1 = x;
+ mRegion.extents.x2 = x + width;
}
void
CompRect::setY (int y)
{
+ int height = mRegion.extents.y2 - mRegion.extents.y1;
+
mRegion.extents.y1 = y;
+ mRegion.extents.y2 = y + height;
}
void
CompRect::setPos (const CompPoint& pos)
{
- mRegion.extents.x1 = pos.x ();
- mRegion.extents.y1 = pos.y ();
+ setX (pos.x ());
+ setY (pos.y ());
}
void