X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-scene3d%2Fpublic-api%2Floader%2Fanimated-property.cpp;h=e357516219610e9370436b39a30b69990e94b14e;hb=HEAD;hp=83ae2dfdae8d5f31e72aca05162745ebe64a82ba;hpb=89641815d206e3bf569f0140ea534146ba8d99c7;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-scene3d/public-api/loader/animated-property.cpp b/dali-scene3d/public-api/loader/animated-property.cpp index 83ae2df..e357516 100644 --- a/dali-scene3d/public-api/loader/animated-property.cpp +++ b/dali-scene3d/public-api/loader/animated-property.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,37 +14,36 @@ * limitations under the License. * */ -#include "dali-scene3d/public-api/loader/animated-property.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// CLASS HEADER +#include + +namespace Dali::Scene3D::Loader { -void AnimatedProperty::Animate(Animation& anim, GetActor getActor) +void AnimatedProperty::Animate(Animation& anim, GetActor getActor) const { if(Actor actor = getActor(*this)) { Property prop = GetProperty(actor); - if(mKeyFrames) - { - anim.AnimateBetween(prop, mKeyFrames, mAlphaFunction, mTimePeriod); - } - else if(mValue) + if(prop.propertyIndex != Property::INVALID_INDEX) { - if(mValue->mIsRelative) + if(mKeyFrames) { - anim.AnimateBy(prop, mValue->mValue, mAlphaFunction, mTimePeriod); + anim.AnimateBetween(prop, mKeyFrames, mAlphaFunction, mTimePeriod); } - else + else if(mValue) { - anim.AnimateTo(prop, mValue->mValue, mAlphaFunction, mTimePeriod); + if(mValue->mIsRelative) + { + anim.AnimateBy(prop, mValue->mValue, mAlphaFunction, mTimePeriod); + } + else + { + anim.AnimateTo(prop, mValue->mValue, mAlphaFunction, mTimePeriod); + } } } } } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader \ No newline at end of file