[ease/inspector] Fixed "Slats" transition.



commit 6153693722681b429c39f9e472030d406e3db294
Author: Nate Stedman <natesm gmail com>
Date:   Fri Jun 4 04:27:16 2010 -0400

    Fixed "Slats" transition.

 Examples/Transitions.ease/Document.json |   40 +++++++++++++++---------------
 src/SlideActor.vala                     |   18 +++++++++----
 2 files changed, 32 insertions(+), 26 deletions(-)
---
diff --git a/Examples/Transitions.ease/Document.json b/Examples/Transitions.ease/Document.json
index a202181..b1f5529 100644
--- a/Examples/Transitions.ease/Document.json
+++ b/Examples/Transitions.ease/Document.json
@@ -3,9 +3,9 @@
   "slides" : [
     {
       "transition" : "1",
-      "automatically_advance" : "true",
       "green" : "34",
       "variant" : "0",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -51,9 +51,9 @@
     },
     {
       "transition" : "2",
-      "automatically_advance" : "true",
       "green" : "255",
       "variant" : "2",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -99,9 +99,9 @@
     },
     {
       "transition" : "3",
-      "automatically_advance" : "true",
       "green" : "34",
       "variant" : "0",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -147,9 +147,9 @@
     },
     {
       "transition" : "4",
-      "automatically_advance" : "true",
       "green" : "255",
       "variant" : "7",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -195,9 +195,9 @@
     },
     {
       "transition" : "5",
-      "automatically_advance" : "true",
       "green" : "34",
       "variant" : "13",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -243,9 +243,9 @@
     },
     {
       "transition" : "6",
-      "automatically_advance" : "true",
       "green" : "255",
       "variant" : "2",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -291,9 +291,9 @@
     },
     {
       "transition" : "7",
-      "automatically_advance" : "true",
       "green" : "34",
       "variant" : "0",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -339,9 +339,9 @@
     },
     {
       "transition" : "8",
-      "automatically_advance" : "true",
       "green" : "255",
       "variant" : "0",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -387,9 +387,9 @@
     },
     {
       "transition" : "10",
-      "automatically_advance" : "true",
       "green" : "34",
       "variant" : "0",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -435,9 +435,9 @@
     },
     {
       "transition" : "11",
-      "automatically_advance" : "true",
       "green" : "255",
       "variant" : "6",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -483,9 +483,9 @@
     },
     {
       "transition" : "12",
-      "automatically_advance" : "true",
       "green" : "34",
       "variant" : "0",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -531,9 +531,9 @@
     },
     {
       "transition" : "13",
-      "automatically_advance" : "true",
       "green" : "255",
       "variant" : "2",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -579,9 +579,9 @@
     },
     {
       "transition" : "15",
-      "automatically_advance" : "true",
       "green" : "34",
       "variant" : "0",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -627,9 +627,9 @@
     },
     {
       "transition" : "16",
-      "automatically_advance" : "true",
       "green" : "255",
       "variant" : "0",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -675,9 +675,9 @@
     },
     {
       "transition" : "14",
-      "automatically_advance" : "true",
       "green" : "34",
       "variant" : "0",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -723,9 +723,9 @@
     },
     {
       "transition" : "17",
-      "automatically_advance" : "true",
       "green" : "255",
       "variant" : "15",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -770,10 +770,10 @@
       "transition_time" : "1"
     },
     {
-      "transition" : "0",
-      "automatically_advance" : "true",
+      "transition" : "9",
       "green" : "34",
       "variant" : "0",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -819,9 +819,9 @@
     },
     {
       "transition" : "0",
-      "automatically_advance" : "true",
       "green" : "255",
       "variant" : "0",
+      "automatically_advance" : "true",
       "advance_delay" : "0.5",
       "elements" : [
         {
@@ -867,4 +867,4 @@
     }
   ],
   "width" : "1024"
-}
+}
\ No newline at end of file
diff --git a/src/SlideActor.vala b/src/SlideActor.vala
index 2788d64..aaf1e2c 100644
--- a/src/SlideActor.vala
+++ b/src/SlideActor.vala
@@ -602,6 +602,9 @@ public class Ease.SlideActor : Clutter.Group
 	private void slats_transition(SlideActor new_slide,
 	                              Clutter.Group container, uint length)
 	{
+		// use depth testing
+		Cogl.set_depth_test_enabled(true);
+	
 		// hide the real SlideActors
 		reparent(container);
 		new_slide.reparent(container);
@@ -636,11 +639,11 @@ public class Ease.SlideActor : Clutter.Group
 			                      width, slide.parent.height);
 
 			// flip the back slats
-			//new_slats[i].set_rotation(Clutter.RotateAxis.Y_AXIS,
-			//                          180, width / 2 + i * width, 0, 0);
+			new_slats[i].set_rotation(Clutter.RotateAxis.Y_AXIS,
+			                          180, width / 2 + i * width, 0, 0);
 			
 			// place the new slats behind the current ones
-			new_slats[i].depth = 5;
+			new_slats[i].depth = -2;
 		}
 
 		// make an alpha for easing
@@ -651,9 +654,9 @@ public class Ease.SlideActor : Clutter.Group
 		animation_time.new_frame.connect((m) => {
 			for (int i = 0; i < SLAT_COUNT; i++)
 			{
-				new_slats[i].set_rotation(Clutter.RotateAxis.Y_AXIS,
-					              180 * animation_alpha.alpha,
-					              (i + 0.5f) * width, 0, 0);
+				groups[i].set_rotation(Clutter.RotateAxis.Y_AXIS,
+					                   180 * animation_alpha.alpha,
+					                   (i + 0.5f) * width, 0, 0);
 				
 			}
 		});
@@ -667,6 +670,9 @@ public class Ease.SlideActor : Clutter.Group
 
 			// put the new slide in place
 			new_slide.x = 0;
+			
+			// disable depth testing
+			Cogl.set_depth_test_enabled(false);
 		});
 	}
 



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