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=590f919a6d4b1fdc77cbbe3f3e95938e1f22298a;hp=7d9933d01e938486ab8eaf5ef24024c637123022;hb=5e86784bcfbc88120549a72284a23b98adbc90ae;hpb=ba7e2eefb4cad9fe2575cdedc56b86fa64bf5833 diff --git a/dali-toolkit/internal/text/text-scroller.cpp b/dali-toolkit/internal/text/text-scroller.cpp index 7d9933d..590f919 100644 --- a/dali-toolkit/internal/text/text-scroller.cpp +++ b/dali-toolkit/internal/text/text-scroller.cpp @@ -233,6 +233,7 @@ void CreateRenderer( FrameBufferImage frameBufferImage, Dali::Renderer& renderer CreateGeometry( meshGeometry ); renderer = Renderer::New( meshGeometry, shader ); + renderer.SetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, true ); renderer.SetTextures( textureSet ); } @@ -310,6 +311,8 @@ void TextScroller::StopScrolling() case DevelTextLabel::AutoScrollStopMode::IMMEDIATE: { mScrollAnimation.Stop(); + CleanUp(); + mScrollerInterface.ScrollingFinished(); break; } case DevelTextLabel::AutoScrollStopMode::FINISH_LOOP: @@ -319,7 +322,7 @@ void TextScroller::StopScrolling() } default: { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Undifined AutoScrollStopMode\n" ); + DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Undifined AutoScrollStopMode\n" ); } } } @@ -363,8 +366,20 @@ void TextScroller::SetParameters( Actor sourceActor, const Size& controlSize, co 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(); } @@ -439,7 +454,8 @@ void TextScroller::SetParameters( Actor sourceActor, const Size& controlSize, co scrollAmount = -scrollAmount; // reverse direction of scrollung } - StartScrolling( scrollAmount, scrollDuration, mLoopCount ); + StartScrolling( scrollAmount, scrollDuration, remainedLoop ); + mScrollAnimation.SetCurrentProgress(animationProgress); } void TextScroller::AutoScrollAnimationFinished( Dali::Animation& animation )