diff options
author | Danny Baumann <dannybaumann@web.de> | 2008-02-12 14:57:27 +0100 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2008-02-12 14:57:27 +0100 |
commit | 0cbc4d0a296de99e1b3fec4ba914665b55dfc167 (patch) | |
tree | 0c1a7c02db1946d85ebd70a7bff820ab3f9e2316 /shelf.c | |
parent | 1c1d074cd7ec2d357c3dbfa60598fa3a4664062f (diff) | |
download | shelf-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.
Diffstat (limited to 'shelf.c')
-rw-r--r-- | shelf.c | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -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; |