case DevelTextLabel::AutoScrollStopMode::IMMEDIATE:
{
mScrollAnimation.Stop();
+ CleanUp();
+ mScrollerInterface.ScrollingFinished();
break;
}
case DevelTextLabel::AutoScrollStopMode::FINISH_LOOP:
}
default:
{
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Undifined AutoScrollStopMode\n" );
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Undifined AutoScrollStopMode\n" );
}
}
}
CleanUp(); // If already scrolling then restart with new parameters
+ float animationProgress = 0.0f;
+ int remainedLoop = mLoopCount;
if ( mScrollAnimation )
{
+ if( mScrollAnimation.GetState() == Animation::PLAYING )
+ {
+ animationProgress = mScrollAnimation.GetCurrentProgress();
+
+ if( mLoopCount > 0 ) // If not a ininity loop, then calculate remained loop
+ {
+ remainedLoop = mLoopCount - ( mScrollAnimation.GetCurrentLoop() );
+ remainedLoop = ( remainedLoop <= 0 ? 1 : remainedLoop );
+ }
+ }
mScrollAnimation.Clear();
}
scrollAmount = -scrollAmount; // reverse direction of scrollung
}
- StartScrolling( scrollAmount, scrollDuration, mLoopCount );
+ StartScrolling( scrollAmount, scrollDuration, remainedLoop );
+ mScrollAnimation.SetCurrentProgress(animationProgress);
}
void TextScroller::AutoScrollAnimationFinished( Dali::Animation& animation )