mIsStop = false;
mScrollAnimation.Stop();
mScrollerInterface.ScrollingFinished();
+ mIsStoppedImmediately.store(true);
break;
}
case TextLabel::AutoScrollStopMode::FINISH_LOOP:
mLoopDelay(0.0f),
mWrapGap(0.0f),
mStopMode(TextLabel::AutoScrollStopMode::FINISH_LOOP),
- mIsStop(false)
+ mIsStop(false),
+ mIsStoppedImmediately(false)
{
DALI_LOG_INFO(gLogFilter, Debug::Verbose, "TextScroller Default Constructor\n");
}
{
DALI_LOG_INFO(gLogFilter, Debug::Verbose, "TextScroller::AutoScrollAnimationFinished\n");
mIsStop = false;
- if(mStopMode == TextLabel::AutoScrollStopMode::FINISH_LOOP)
+ if(!mIsStoppedImmediately.load())
{
mScrollerInterface.ScrollingFinished();
}
void TextScroller::StartScrolling(Actor scrollingTextActor, float scrollAmount, float scrollDuration, int loopCount)
{
+ mIsStoppedImmediately.store(false);
+
DALI_LOG_INFO(gLogFilter, Debug::Verbose, "TextScroller::StartScrolling scrollAmount[%f] scrollDuration[%f], loop[%d] speed[%d]\n", scrollAmount, scrollDuration, loopCount, mScrollSpeed);
Shader shader = mRenderer.GetShader();
mScrollAnimation = Animation::New(scrollDuration);
Shader mShader; // Shader originally used by the renderer while not scrolling
TextureSet mTextureSet; // Texture originally used by the renderer while not scrolling
- int mScrollSpeed; ///< Speed which text should automatically scroll at
- int mLoopCount; ///< Number of time the text should scroll
- float mLoopDelay; ///< Time delay of loop start
- float mWrapGap; ///< Gap before text wraps around when scrolling
- TextLabel::AutoScrollStopMode::Type mStopMode; ///< Stop mode of scrolling text, when loop count is 0.
- bool mIsStop : 1; ///< Whether the stop scrolling has been triggered or not.
+ int mScrollSpeed; ///< Speed which text should automatically scroll at
+ int mLoopCount; ///< Number of time the text should scroll
+ float mLoopDelay; ///< Time delay of loop start
+ float mWrapGap; ///< Gap before text wraps around when scrolling
+ TextLabel::AutoScrollStopMode::Type mStopMode; ///< Stop mode of scrolling text, when loop count is 0.
+ bool mIsStop : 1; ///< Whether the stop scrolling has been triggered or not.
+ std::atomic<bool> mIsStoppedImmediately; ///< Whether the stop is triggered by immediate stop.
}; // TextScroller class