Fixing Gap in Text Scrolling 18/72818/1
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Thu, 2 Jun 2016 12:13:40 +0000 (13:13 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Thu, 2 Jun 2016 12:13:40 +0000 (13:13 +0100)
The patch to make the gap public api take an int was causing a problem in the shader
Now casting to a float before used by shader

Change-Id: I57eda6777795f679225921eddc23ae2a3180cf75

dali-toolkit/internal/text/text-scroller.cpp
dali-toolkit/internal/text/text-scroller.h

index 1201619..3c9b450 100644 (file)
@@ -197,12 +197,12 @@ TextScrollerPtr TextScroller::New( ScrollerInterface& scrollerInterface )
 void TextScroller::SetGap( int gap )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetGap gap[%d]\n", gap );
-  mWrapGap = gap;
+  mWrapGap = static_cast<float>(gap);
 }
 
 int TextScroller::GetGap() const
 {
-  return mWrapGap;
+  return static_cast<int>(mWrapGap);
 }
 
 void TextScroller::SetSpeed( int scrollSpeed )
@@ -252,7 +252,7 @@ TextScroller::TextScroller( ScrollerInterface& scrollerInterface ) : mScrollerIn
                             mScrollDeltaIndex( Property::INVALID_INDEX ),
                             mScrollSpeed( MINIMUM_SCROLL_SPEED ),
                             mLoopCount( 1 ),
-                            mWrapGap( 0 )
+                            mWrapGap( 0.0f )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller Default Constructor\n" );
 }
@@ -286,7 +286,7 @@ void TextScroller::SetParameters( Actor sourceActor, const Size& controlSize, co
 
   mOffscreenCameraActor.SetY( offScreenSize.height * 0.5f );
 
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters mWrapGap[%d]\n", mWrapGap )
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters mWrapGap[%f]\n", mWrapGap )
 
   mScrollingTextActor = Actor::New();
   mScrollingTextActor.AddRenderer( renderer );
index ef50b77..17824b6 100644 (file)
@@ -161,9 +161,9 @@ private:
   Property::Index    mScrollDeltaIndex;         // Property used by shader to represent distance to scroll
   Animation          mScrollAnimation;          // Animation used to update the mScrollDeltaIndex
 
-  int mScrollSpeed;            ///< Speed which text should automatically scroll at
-  int mLoopCount;              ///< Number of time the text should scroll
-  int mWrapGap;                ///< Gap before text wraps around when scrolling
+  int   mScrollSpeed;            ///< Speed which text should automatically scroll at
+  int   mLoopCount;              ///< Number of time the text should scroll
+  float mWrapGap;                ///< Gap before text wraps around when scrolling
 
 }; // TextScroller class