summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2008-02-12 14:57:27 +0100
committerDanny Baumann <dannybaumann@web.de>2008-02-12 14:57:27 +0100
commit0cbc4d0a296de99e1b3fec4ba914665b55dfc167 (patch)
tree0c1a7c02db1946d85ebd70a7bff820ab3f9e2316
parent1c1d074cd7ec2d357c3dbfa60598fa3a4664062f (diff)
downloadshelf-0cbc4d0a296de99e1b3fec4ba914665b55dfc167.tar.gz
shelf-0cbc4d0a296de99e1b3fec4ba914665b55dfc167.tar.bz2
We don't translate by the border side, we translate by the amount the border became smaller through scaling.
-rw-r--r--shelf.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/shelf.c b/shelf.c
index 76f0350..bff32c3 100644
--- a/shelf.c
+++ b/shelf.c
@@ -712,8 +712,13 @@ shelfDamageWindowRect (CompWindow *w,
if (sw->scale != 1.0f)
{
+ float xTranslate, yTranslate;
+
+ xTranslate = w->input.left * (sw->scale - 1.0f);
+ yTranslate = w->input.top * (sw->scale - 1.0f);
+
damageTransformedWindowRect (w, sw->scale, sw->scale,
- -w->input.left, -w->input.top, rect);
+ xTranslate, yTranslate, rect);
status = TRUE;
}
@@ -752,14 +757,17 @@ shelfPaintWindow (CompWindow *w,
if (sw->scale != 1.0f)
{
CompTransform mTransform = *transform;
- int xOrigin, yOrigin;
+ float xTranslate, yTranslate;
- xOrigin = w->attrib.x - w->input.left;
- yOrigin = w->attrib.y - w->input.top;
+ xTranslate = w->input.left * (sw->scale - 1.0f);
+ yTranslate = w->input.top * (sw->scale - 1.0f);
- matrixTranslate (&mTransform, xOrigin, yOrigin, 0);
+ matrixTranslate (&mTransform, w->attrib.x, w->attrib.y, 0);
matrixScale (&mTransform, sw->scale, sw->scale, 0);
- matrixTranslate (&mTransform, -xOrigin, -yOrigin, 0);
+ matrixTranslate (&mTransform,
+ xTranslate / sw->scale - w->attrib.x,
+ yTranslate / sw->scale - w->attrib.y,
+ 0.0f);
mask |= PAINT_WINDOW_TRANSFORMED_MASK;