Fix text scrolling bug 85/165285/4
authorminho.sun <minho.sun@samsung.com>
Thu, 28 Dec 2017 01:31:07 +0000 (10:31 +0900)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 2 Jan 2018 15:17:14 +0000 (15:17 +0000)
Change if statement for text scrolling.
Even if text is longer than control, Elided state can be false.

So, comparing texture width with control width is better way.

Change-Id: Iea613cd1bcfc3ecb3bc562cd106367fe00dc4891
Signed-off-by: minho.sun <minho.sun@samsung.com>
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/text/text-scroller.cpp
dali-toolkit/internal/text/text-scroller.h

index 0cbb799..3f420b5 100644 (file)
@@ -1021,7 +1021,7 @@ void TextLabel::SetUpAutoScrolling()
 
   // Set parameters for scrolling
   Renderer renderer = static_cast<Internal::Visual::Base&>( GetImplementation( mVisual ) ).GetRenderer();
 
   // Set parameters for scrolling
   Renderer renderer = static_cast<Internal::Visual::Base&>( GetImplementation( mVisual ) ).GetRenderer();
-  mTextScroller->SetParameters( Self(), renderer, textureSet, controlSize, verifiedSize, wrapGap, direction, mController->GetHorizontalAlignment(), mController->GetVerticalAlignment(), mController->IsTextElideEnabled() );
+  mTextScroller->SetParameters( Self(), renderer, textureSet, controlSize, verifiedSize, wrapGap, direction, mController->GetHorizontalAlignment(), mController->GetVerticalAlignment() );
 }
 
 void TextLabel::ScrollingFinished()
 }
 
 void TextLabel::ScrollingFinished()
index a1bb52a..fab9327 100644 (file)
@@ -257,7 +257,7 @@ TextScroller::~TextScroller()
 {
 }
 
 {
 }
 
-void TextScroller::SetParameters( Actor scrollingTextActor, Renderer renderer, TextureSet textureSet, const Size& controlSize, const Size& textureSize, const float wrapGap, CharacterDirection direction, HorizontalAlignment::Type horizontalAlignment, VerticalAlignment::Type verticalAlignment, bool isTextElided )
+void TextScroller::SetParameters( Actor scrollingTextActor, Renderer renderer, TextureSet textureSet, const Size& controlSize, const Size& textureSize, const float wrapGap, CharacterDirection direction, HorizontalAlignment::Type horizontalAlignment, VerticalAlignment::Type verticalAlignment )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters controlSize[%f,%f] textureSize[%f,%f] direction[%d]\n",
                  controlSize.x, controlSize.y, textureSize.x, textureSize.y, direction );
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters controlSize[%f,%f] textureSize[%f,%f] direction[%d]\n",
                  controlSize.x, controlSize.y, textureSize.x, textureSize.y, direction );
@@ -297,7 +297,7 @@ void TextScroller::SetParameters( Actor scrollingTextActor, Renderer renderer, T
 
   float horizontalAlign;
 
 
   float horizontalAlign;
 
-  if( isTextElided )
+  if( textureSize.x > controlSize.x )
   {
     // if Text is elided, scroll should start at the begin of text.
     horizontalAlign = HORIZONTAL_ALIGNMENT_TABLE[HorizontalAlignment::BEGIN][ direction ];
   {
     // if Text is elided, scroll should start at the begin of text.
     horizontalAlign = HORIZONTAL_ALIGNMENT_TABLE[HorizontalAlignment::BEGIN][ direction ];
@@ -306,7 +306,9 @@ void TextScroller::SetParameters( Actor scrollingTextActor, Renderer renderer, T
   {
     horizontalAlign = HORIZONTAL_ALIGNMENT_TABLE[ horizontalAlignment ][ direction ];
   }
   {
     horizontalAlign = HORIZONTAL_ALIGNMENT_TABLE[ horizontalAlignment ][ direction ];
   }
+
   const float verticalAlign = VERTICAL_ALIGNMENT_TABLE[ verticalAlignment ];
   const float verticalAlign = VERTICAL_ALIGNMENT_TABLE[ verticalAlignment ];
+
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters horizontalAlign[%f], verticalAlign[%f]\n", horizontalAlign, verticalAlign );
 
   scrollingTextActor.RegisterProperty( "uTextureSize", textureSize );
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters horizontalAlign[%f], verticalAlign[%f]\n", horizontalAlign, verticalAlign );
 
   scrollingTextActor.RegisterProperty( "uTextureSize", textureSize );
index 4000023..a7a6410 100644 (file)
@@ -70,9 +70,8 @@ public:
    * @param[in] direction text direction true for right to left text
    * @param[in] horizontalAlignment horizontal alignment of the text
    * @param[in] verticalAlignment vertical alignment of the text
    * @param[in] direction text direction true for right to left text
    * @param[in] horizontalAlignment horizontal alignment of the text
    * @param[in] verticalAlignment vertical alignment of the text
-   * @param[in] isTextElided whether text is elided or not
    */
    */
-  void SetParameters( Actor scrollingTextActor, Dali::Renderer renderer, TextureSet textureSet, const Size& controlSize, const Size& textureSize, const float wrapGap, CharacterDirection direction, HorizontalAlignment::Type horizontalAlignment, VerticalAlignment::Type verticalAlignment, bool isTextElided );
+  void SetParameters( Actor scrollingTextActor, Dali::Renderer renderer, TextureSet textureSet, const Size& controlSize, const Size& textureSize, const float wrapGap, CharacterDirection direction, HorizontalAlignment::Type horizontalAlignment, VerticalAlignment::Type verticalAlignment );
 
   /**
    * @brief Set the gap distance to elapse before the text wraps around
 
   /**
    * @brief Set the gap distance to elapse before the text wraps around