Look into the range of animatable properties while retrieving Actor's constraint... 04/37404/2
authorRichard Huang <r.huang@samsung.com>
Wed, 25 Mar 2015 17:28:52 +0000 (17:28 +0000)
committerRichard Huang <r.huang@samsung.com>
Mon, 30 Mar 2015 10:25:38 +0000 (03:25 -0700)
Change-Id: I078c54679b93b4cbaf835343b7bae81e4a6015ac

dali/internal/event/actors/actor-impl.cpp

index 427b749..e5b33ce 100644 (file)
@@ -2991,7 +2991,13 @@ const PropertyBase* Actor::GetSceneObjectAnimatableProperty( Property::Index ind
     return property;
   }
 
-  if ( static_cast<unsigned int>(index) >= DEFAULT_PROPERTY_MAX_COUNT )
+  if ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX && index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX )
+  {
+    AnimatablePropertyMetadata* animatable = FindAnimatableProperty( index );
+    DALI_ASSERT_ALWAYS( animatable && "Property index is invalid" );
+    property = animatable->GetSceneGraphProperty();
+  }
+  else if ( index >= DEFAULT_PROPERTY_MAX_COUNT )
   {
     CustomPropertyMetadata* custom = FindCustomProperty( index );
     DALI_ASSERT_ALWAYS( custom && "Property index is invalid" );
@@ -3096,7 +3102,13 @@ const PropertyInputImpl* Actor::GetSceneObjectInputProperty( Property::Index ind
     return property;
   }
 
-  if ( index >= DEFAULT_PROPERTY_MAX_COUNT )
+  if ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX && index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX )
+  {
+    AnimatablePropertyMetadata* animatable = FindAnimatableProperty( index );
+    DALI_ASSERT_ALWAYS( animatable && "Property index is invalid" );
+    property = animatable->GetSceneGraphProperty();
+  }
+  else if ( index >= DEFAULT_PROPERTY_MAX_COUNT )
   {
     CustomPropertyMetadata* custom = FindCustomProperty( index );
     DALI_ASSERT_ALWAYS( custom && "Property index is invalid" );