Fixed Builder not allowing nested maps for properties 90/57290/2
authorTom Robinson <tom.robinson@samsung.com>
Mon, 18 Jan 2016 15:50:01 +0000 (15:50 +0000)
committerTom Robinson <tom.robinson@samsung.com>
Thu, 28 Jan 2016 14:58:06 +0000 (06:58 -0800)
Change-Id: I4ff1fa3edddd0cd76310f495fbf53bf199dc768f

dali/devel-api/scripting/scripting.cpp

index 33a3891..978fcaf 100644 (file)
@@ -817,14 +817,18 @@ void NewAnimation( const Property::Map& map, Dali::AnimationData& outputAnimatio
     }
     else if( key == "timePeriod" )
     {
-      Property::Array timeArray = value.Get< Property::Array >();
-
-      // TODO: Builder treats "{" within a Property::Map as a Property::Array.
-      // This means there is no key to determine what the values belong to.
-      if( timeArray.Size() >= 2 )
+      Property::Map timeMap = value.Get< Property::Map >();
+      for( unsigned int i = 0; i < timeMap.Count(); ++i )
       {
-        element->timePeriodDelay = timeArray[0].Get< float >();
-        element->timePeriodDuration = timeArray[1].Get< float >();
+        const StringValuePair& pair( timeMap.GetPair( i ) );
+        if( pair.first == "delay" )
+        {
+          element->timePeriodDelay = pair.second.Get< float >();
+        }
+        else if( pair.first == "duration" )
+        {
+          element->timePeriodDuration = pair.second.Get< float >();
+        }
       }
     }
   }