}
}
+void Animation::Bake(BufferIndex bufferIndex, EndAction action)
+{
+ if( action == Dali::Animation::BakeFinal )
+ {
+ if( mSpeedFactor > 0.0f )
+ {
+ mElapsedSeconds = mDurationSeconds + Math::MACHINE_EPSILON_1; // Force animation to reach it's end
+ }
+ else
+ {
+ mElapsedSeconds = 0.0f - Math::MACHINE_EPSILON_1; //Force animation to reach it's beginning
+ }
+ }
+
+ UpdateAnimators(bufferIndex, true/*bake the final result*/);
+}
+
bool Animation::Stop(BufferIndex bufferIndex)
{
bool animationFinished(false);
if( mEndAction != Dali::Animation::Discard )
{
- if( mEndAction == Dali::Animation::BakeFinal )
- {
- if( mSpeedFactor > 0.0f )
- {
- mElapsedSeconds = mDurationSeconds + Math::MACHINE_EPSILON_1; // Force animation to reach it's end
- }
- else
- {
- mElapsedSeconds = 0.0f - Math::MACHINE_EPSILON_1; //Force animation to reach it's beginning
- }
-
- }
- UpdateAnimators(bufferIndex, true/*bake the final result*/);
+ Bake( bufferIndex, mEndAction );
}
// The animation has now been played to completion
{
if (mDestroyAction != Dali::Animation::Discard)
{
- UpdateAnimators(bufferIndex, true/*bake the final result*/);
+ Bake( bufferIndex, mDestroyAction );
}
}
*/
void UpdateAnimators(BufferIndex bufferIndex, bool bake);
+ /**
+ * Helper function to bake the result of the animation when it is stopped or
+ * destroyed.
+ * @param[in] bufferIndex The buffer to update.
+ * @param[in] action The end action specified.
+ */
+ void Bake(BufferIndex bufferIndex, EndAction action );
+
// Undefined
Animation(const Animation&);