X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=dali%2Finternal%2Fevent%2Fanimation%2Flinear-constrainer-impl.cpp;h=593e62b277646fbf983c6b85916d824eb0748adc;hb=965cb6a5f633173bf5afdaf9e8c7481b33e8f4e4;hp=22c9dfe22654edb45d7af761ff0cbf4af8ca3002;hpb=47eb44ba902ff28a13479d1d9152f9899ec7a759;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/animation/linear-constrainer-impl.cpp b/dali/internal/event/animation/linear-constrainer-impl.cpp index 22c9dfe..593e62b 100644 --- a/dali/internal/event/animation/linear-constrainer-impl.cpp +++ b/dali/internal/event/animation/linear-constrainer-impl.cpp @@ -24,6 +24,8 @@ // INTERNAL INCLUDES #include #include +#include + namespace Dali { @@ -113,47 +115,59 @@ Property::Type LinearConstrainer::GetDefaultPropertyType(Property::Index index) Property::Value LinearConstrainer::GetDefaultProperty( Property::Index index ) const { - Property::Value value; if( index == Dali::LinearConstrainer::Property::VALUE ) { - value = Property::Value(Property::ARRAY); + Property::Value value( Property::ARRAY ); + Property::Array* array = value.GetArray(); + DALI_ASSERT_DEBUG( array ); // should always exist in this case size_t count( mValue.Size() ); + array->Reserve( count ); for( size_t i( 0 ); i != count; ++i ) { - value.AppendItem( mValue[i] ); + array->PushBack( mValue[i] ); } + return value; } else if( index == Dali::LinearConstrainer::Property::PROGRESS ) { - value = Property::Value(Property::ARRAY); + Property::Value value( Property::ARRAY ); + Property::Array* array = value.GetArray(); + DALI_ASSERT_DEBUG( array ); // should always exist in this case size_t count( mValue.Size() ); + array->Reserve( count ); for( size_t i( 0 ); i != count; ++i ) { - value.AppendItem( mProgress[i] ); + array->PushBack( mProgress[i] ); } + return value; } - return value; + return Property::Value(); } -void LinearConstrainer::SetDefaultProperty(Property::Index index, const Property::Value& propertyValue) +void LinearConstrainer::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue ) { - if( index == Dali::LinearConstrainer::Property::VALUE ) + const Property::Array* array = propertyValue.GetArray(); + if( array ) { - size_t propertyArrayCount = propertyValue.GetSize(); - mValue.Resize( propertyArrayCount ); - for( size_t i(0); i != propertyArrayCount; ++i ) + size_t propertyArrayCount = array->Count(); + if( index == Dali::LinearConstrainer::Property::VALUE ) { - propertyValue.GetItem(i).Get( mValue[i] ); + mValue.Clear(); // remove old values + mValue.Resize( propertyArrayCount ); + for( size_t i(0); i != propertyArrayCount; ++i ) + { + array->GetElementAt( i ).Get( mValue[ i ] ); + } } - } - else if( index == Dali::LinearConstrainer::Property::PROGRESS ) - { - size_t propertyArrayCount = propertyValue.GetSize(); - mProgress.Resize( propertyArrayCount ); - for( size_t i(0); i != propertyArrayCount; ++i ) + else if( index == Dali::LinearConstrainer::Property::PROGRESS ) { - propertyValue.GetItem(i).Get( mProgress[i] ); + mProgress.Clear(); // remove old values + mProgress.Resize( propertyArrayCount ); + for( size_t i(0); i != propertyArrayCount; ++i ) + { + array->GetElementAt( i ).Get( mProgress[ i ] ); + } } } }