Fix builder animation
authorLee Morgan <Lee.morgan@partner.samsung.com>
Tue, 15 Apr 2014 13:51:00 +0000 (14:51 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 16 Apr 2014 15:46:56 +0000 (16:46 +0100)
[Issue#]   N/A
[Problem]  Crash with no animation duration from json
[Cause]    Bug in change to support animations where properties have no time-period
[Solution] N/A.

Change-Id: Icf685250e7bf529a0c0ff1751a2f24e7f7aca4fd
Signed-off-by: Lee Morgan <Lee.morgan@partner.samsung.com>
dali-toolkit/internal/builder/builder-animations.cpp

index 82a0669..4e26ad6 100644 (file)
@@ -164,10 +164,6 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D
   {
     animation.SetDuration( *duration );
   }
   {
     animation.SetDuration( *duration );
   }
-  else
-  {
-    animation.SetDuration( durationSum );
-  }
 
   if( OptionalBoolean looping = constant.IsBoolean(  IsChild(child, "loop" ) ) )
   {
 
   if( OptionalBoolean looping = constant.IsBoolean(  IsChild(child, "loop" ) ) )
   {
@@ -354,6 +350,11 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D
     }
   }
 
     }
   }
 
+  if( !duration )
+  {
+    animation.SetDuration( durationSum );
+  }
+
   return animation;
 }
 
   return animation;
 }