X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-scroller.cpp;h=22f115692a3917c74e39d7ef4da4fee290a82e4b;hp=8fba9b585c0b1cb4908531e9e58ac923d1afc3b1;hb=528aa3699cd51dab5115bca1aaebb65d4bc67c15;hpb=80142a09456f71b826e4f557bfc8c0bb3abd45ff diff --git a/dali-toolkit/internal/text/text-scroller.cpp b/dali-toolkit/internal/text/text-scroller.cpp index 8fba9b5..22f1156 100644 --- a/dali-toolkit/internal/text/text-scroller.cpp +++ b/dali-toolkit/internal/text/text-scroller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -19,7 +19,6 @@ #include // EXTERNAL INCLUDES -#include #include // INTERNAL INCLUDES @@ -301,11 +300,11 @@ void TextScroller::SetParameters( Actor scrollingTextActor, Renderer renderer, T DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters horizontalAlign[%f], verticalAlign[%f]\n", horizontalAlign, verticalAlign ); - scrollingTextActor.RegisterProperty( "uTextureSize", textureSize ); - scrollingTextActor.RegisterProperty( "uHorizontalAlign", horizontalAlign ); - scrollingTextActor.RegisterProperty( "uVerticalAlign", verticalAlign ); - scrollingTextActor.RegisterProperty( "uGap", wrapGap ); - mScrollDeltaIndex = scrollingTextActor.RegisterProperty( "uDelta", 0.0f ); + shader.RegisterProperty( "uTextureSize", textureSize ); + shader.RegisterProperty( "uHorizontalAlign", horizontalAlign ); + shader.RegisterProperty( "uVerticalAlign", verticalAlign ); + shader.RegisterProperty( "uGap", wrapGap ); + mScrollDeltaIndex = shader.RegisterProperty( "uDelta", 0.0f ); float scrollAmount = std::max( textureSize.width, controlSize.width ); float scrollDuration = scrollAmount / mScrollSpeed; @@ -336,9 +335,10 @@ void TextScroller::StartScrolling( Actor scrollingTextActor, float scrollAmount, { 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 ); - mScrollAnimation.AnimateTo( Property( scrollingTextActor, mScrollDeltaIndex ), scrollAmount, TimePeriod( mLoopDelay, scrollDuration ) ); - mScrollAnimation.SetEndAction( Animation::Discard ); + mScrollAnimation.AnimateTo( Property( shader, mScrollDeltaIndex ), scrollAmount, TimePeriod( mLoopDelay, scrollDuration ) ); + mScrollAnimation.SetEndAction( Animation::DISCARD ); mScrollAnimation.SetLoopCount( loopCount ); mScrollAnimation.FinishedSignal().Connect( this, &TextScroller::AutoScrollAnimationFinished ); mScrollAnimation.Play();