From 46824865484af592743a88115a3f6d2a4a8ec667 Mon Sep 17 00:00:00 2001 From: "minho.sun" Date: Fri, 22 Dec 2017 13:40:58 +0900 Subject: [PATCH] [4.0] Fix text scroll start position issue When user sets textlabel auto scroll, it starts after aligning. It makes long text start its scrolling at the odd position when horizontal alignment is not begin. Makes long text always start its scrolling at the begin position even if horizontal alignment is set. Change-Id: Ie54bbb570fdce4d92b1178614e2e64951a77dba9 --- dali-toolkit/internal/text/text-scroller.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dali-toolkit/internal/text/text-scroller.cpp b/dali-toolkit/internal/text/text-scroller.cpp index be83736..afe7005 100644 --- a/dali-toolkit/internal/text/text-scroller.cpp +++ b/dali-toolkit/internal/text/text-scroller.cpp @@ -295,7 +295,17 @@ void TextScroller::SetParameters( Actor scrollingTextActor, Renderer renderer, T DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters wrapGap[%f]\n", wrapGap ); - const float horizontalAlign = HORIZONTAL_ALIGNMENT_TABLE[ horizontalAlignment ][ direction ]; + float horizontalAlign; + + if( textureSize.x > controlSize.x ) + { + // if Text is elided, scroll should start at the begin of text. + horizontalAlign = HORIZONTAL_ALIGNMENT_TABLE[HorizontalAlignment::BEGIN][ direction ]; + } + else + { + horizontalAlign = HORIZONTAL_ALIGNMENT_TABLE[ horizontalAlignment ][ direction ]; + } const float verticalAlign = VERTICAL_ALIGNMENT_TABLE[ verticalAlignment ]; DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters horizontalAlign[%f], verticalAlign[%f]\n", horizontalAlign, verticalAlign ); -- 2.7.4