[ease] [transitions] Tweak "Assemble" transition



commit 54fbb9f67023a47b6bb7fd1c63554ccb8ddfcd2f
Author: Nate Stedman <natesm gmail com>
Date:   Mon Jul 26 19:12:24 2010 -0400

    [transitions] Tweak "Assemble" transition

 src/ease-document.vala    |    2 +-
 src/ease-slide-actor.vala |   26 ++++++++++++++------------
 2 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/src/ease-document.vala b/src/ease-document.vala
index 96cf518..37ebf04 100644
--- a/src/ease-document.vala
+++ b/src/ease-document.vala
@@ -21,7 +21,7 @@
  * The Ease Document class is generated from JSON and writes back to JSON
  * when saved.
  */
-public class Ease.Document : GLib.Object
+public class Ease.Document : GLib.Object, UndoSource
 {
 	private const string MEDIA_PATH = "Media";
 	
diff --git a/src/ease-slide-actor.vala b/src/ease-slide-actor.vala
index 27692b2..4d948d3 100644
--- a/src/ease-slide-actor.vala
+++ b/src/ease-slide-actor.vala
@@ -125,7 +125,7 @@ public class Ease.SlideActor : Clutter.Group
 	private const int EXPLODE_PARTICLES = 10;
 	
 	/**
-	 *
+	 * The number of tiles across the side in the assemble transition.
 	 */
 	private const int ASSEMBLE_TILES = 12;
 	
@@ -1495,28 +1495,25 @@ public class Ease.SlideActor : Clutter.Group
 				switch (Random.int_range(0, 4))
 				{
 					case 0:
-						particles[i].x = -(hpos + 1) * size;
+						particles[i].x = -(hpos + 1) * size - assemble_extra();
 						anim_x = true;
 						break;
 					case 1:
-						particles[i].y = -(vpos + 1) * size;
+						particles[i].y = -(vpos + 1) * size - assemble_extra();
 						break;
 					case 2:
-						particles[i].x = (ASSEMBLE_TILES - hpos + 1) * size;
+						particles[i].x = (ASSEMBLE_TILES - hpos + 1) * size +
+						                 assemble_extra();
 						anim_x = true;
 						break;
 					case 3:
-						particles[i].y = (v_count - vpos + 1) * size;
+						particles[i].y = (v_count - vpos + 1) * size +
+						                 assemble_extra();
 						break;
 				}
 				
-				/*var time = (uint)(50 + Random.next_double() * (length - 50));
-				var timer = new Clutter.Timeline(time);
-				timer.completed.connect(() => {*/
-					particles[i].animate(Clutter.AnimationMode.EASE_OUT_SINE,
-					                     length, anim_x ? "x" : "y", 0);
-				//});
-				//timer.start();
+				particles[i].animate(Clutter.AnimationMode.EASE_IN_OUT_SINE,
+					                 length, anim_x ? "x" : "y", 0);
 				container.add_actor(particles[i]);
 				particles[i].show();
 			}
@@ -1535,6 +1532,11 @@ public class Ease.SlideActor : Clutter.Group
 		});
 	}
 	
+	private float assemble_extra()
+	{
+		return Random.int_range(0, 1000);
+	}
+	
 	private float explode_dist()
 	{
 		return Random.int_range(10, 200);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]