All pastes #901176 Raw Edit

Etwas

public text v1 · immutable
·published 2008-02-12 13:54 UTC
rendered paste body
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;