From 67f5e8f38356b45ff795cf83683baeba6f3e1a0b Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Thu, 14 Nov 2019 17:21:25 +0900 Subject: [PATCH] Fix text jitter issue Text jitter issue occurs when set a text again during text scrolling. It is because the same property is used by the old and new animations. 2 PropertyResetters affect the same property. So I've changed to use properties of Shader which is newly created every time. Then the same property is not used by the old and new animation now. Change-Id: I7ec9b266b0be48414d8df5e3ffead6e5c750b338 --- dali-toolkit/internal/text/text-scroller.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dali-toolkit/internal/text/text-scroller.cpp b/dali-toolkit/internal/text/text-scroller.cpp index 8fba9b5..6ad85d4 100644 --- a/dali-toolkit/internal/text/text-scroller.cpp +++ b/dali-toolkit/internal/text/text-scroller.cpp @@ -301,11 +301,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,8 +336,9 @@ 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.AnimateTo( Property( shader, mScrollDeltaIndex ), scrollAmount, TimePeriod( mLoopDelay, scrollDuration ) ); mScrollAnimation.SetEndAction( Animation::Discard ); mScrollAnimation.SetLoopCount( loopCount ); mScrollAnimation.FinishedSignal().Connect( this, &TextScroller::AutoScrollAnimationFinished ); -- 2.7.4