[fusion-commits] Animation plugin: Changes to 'master' (430b589f16b47b58978723e1932ef735c1108b4f)

cornelius at server.beryl-project.org cornelius at server.beryl-project.org
Thu Jul 5 11:06:53 CEST 2007


New commits:
commit 430b589f16b47b58978723e1932ef735c1108b4f
Author: Danny Baumann <maniac at opencompositing.org>
Date:   Thu Jul 5 05:06:29 2007 -0400

    Fix missing anim with transparent cube in magic lamp, dream, folds.


 animation.c |   80 ++++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 50 insertions(+), 30 deletions(-)


Modified: fusion/plugins/animation/animation.c
===================================================================
--- fusion/plugins/animation/animation.c
+++ fusion/plugins/animation/animation.c
@@ -941,6 +941,20 @@ modelInitObjects(Model * model, int x, int y, int width, int height)
 	}
 }
 
+static void
+modelMove (Model *model,
+		   float tx,
+		   float ty)
+{
+    int i;
+
+    for (i = 0; i < model->numObjects; i++)
+    {
+		model->objects[i].position.x += tx;
+		model->objects[i].position.y += ty;
+    }
+}
+
 static Model *createModel(CompWindow * w,
 						  WindowEvent forWindowEvent,
 						  AnimEffect forAnimEffect, int gridWidth,
@@ -3559,47 +3573,53 @@ animWindowMoveNotify(CompWindow * w, int dx, int dy, Bool immediate)
 	ANIM_SCREEN(w->screen);
 	ANIM_WINDOW(w);
 
-	if (!(aw->animRemainingTime > 0 &&
-		  (aw->curAnimEffect == AnimEffectFocusFade ||
-		   aw->curAnimEffect == AnimEffectDodge)))
+	if (!immediate)
 	{
-		CompWindow *w2;
-
-		if (aw->polygonSet && !aw->animInitialized)
-		{
-			// to refresh polygon coords
-			freePolygonSet(aw);
-		}
-		if (aw->animRemainingTime > 0 && aw->grabbed)
+		if (!(aw->animRemainingTime > 0 &&
+			  (aw->curAnimEffect == AnimEffectFocusFade ||
+			   aw->curAnimEffect == AnimEffectDodge)))
 		{
-			aw->animRemainingTime = 0;
-			if (as->animInProgress)
+			CompWindow *w2;
+
+			if (aw->polygonSet && !aw->animInitialized)
+			{
+				// to refresh polygon coords
+				freePolygonSet(aw);
+			}
+			if (aw->animRemainingTime > 0 && aw->grabbed)
 			{
-				Bool animStillInProgress = FALSE;
-				for (w2 = w->screen->windows; w2; w2 = w2->next)
+				aw->animRemainingTime = 0;
+				if (as->animInProgress)
 				{
-					AnimWindow *aw2;
-
-					aw2 = GET_ANIM_WINDOW(w2, as);
-					if (aw2->animRemainingTime > 0)
+					Bool animStillInProgress = FALSE;
+					for (w2 = w->screen->windows; w2; w2 = w2->next)
 					{
-						animStillInProgress = TRUE;
-						break;
+						AnimWindow *aw2;
+
+						aw2 = GET_ANIM_WINDOW(w2, as);
+						if (aw2->animRemainingTime > 0)
+						{
+							animStillInProgress = TRUE;
+							break;
+						}
 					}
-				}
 
-				if (!animStillInProgress)
-					animActivateEvent(w->screen, FALSE);
+					if (!animStillInProgress)
+						animActivateEvent(w->screen, FALSE);
+				}
+				postAnimationCleanup(w, TRUE);
 			}
-			postAnimationCleanup(w, TRUE);
-		}
 
-		if (aw->model)
-		{
-			modelInitObjects(aw->model, WIN_X(w), WIN_Y(w), WIN_W(w),
-							 WIN_H(w));
+			if (aw->model)
+			{
+				modelInitObjects(aw->model, WIN_X(w), WIN_Y(w), WIN_W(w),
+								 WIN_H(w));
+			}
 		}
 	}
+	else if (aw->model)
+		modelMove (aw->model, dx, dy);
+
 	UNWRAP(as, w->screen, windowMoveNotify);
 	(*w->screen->windowMoveNotify) (w, dx, dy, immediate);
 	WRAP(as, w->screen, windowMoveNotify, animWindowMoveNotify);


More information about the commits mailing list