GetNaturalSize was changing the controlSize to MAX_FLOAT before relayout but only restoring the control width, now does height too.
Gap for AutoScrolling changed from float to int, don't want less than a pixel.
Change-Id: I0c1c391e5565eee8b45d4f28492129d1211d8de8
void TextLabel::SetUpAutoScrolling()
{
void TextLabel::SetUpAutoScrolling()
{
- const Size& controlSize = mController->GetView().GetControlSize(); // Needs to be a ref as the control-size can be changed by GetNaturalSize()
+ const Size& controlSize = mController->GetView().GetControlSize();
const Size offScreenSize = GetNaturalSize().GetVectorXY(); // As relayout of text may not be done at this point natural size is used to get size. Single line scrolling only.
const Vector2& alignmentOffset = mController->GetAlignmentOffset();
const Text::CharacterDirection direction = mController->GetAutoScrollDirection();
const Size offScreenSize = GetNaturalSize().GetVectorXY(); // As relayout of text may not be done at this point natural size is used to get size. Single line scrolling only.
const Vector2& alignmentOffset = mController->GetAlignmentOffset();
const Text::CharacterDirection direction = mController->GetAutoScrollDirection();
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::SetUpAutoScrolling alignmentOffset[%f] offScreenSize[%f]\n", alignmentOffset.x, offScreenSize.width);
+ DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::SetUpAutoScrolling alignmentOffset[%f,%f] offScreenSize[%f,%f] controlSize[%f,%f]\n",
+ alignmentOffset.x, alignmentOffset.y, offScreenSize.x,offScreenSize.y , controlSize.x,controlSize.y);
mImpl->mTextUpdateInfo.mParagraphCharacterIndex = 0u;
mImpl->mTextUpdateInfo.mRequestedNumberOfCharacters = mImpl->mLogicalModel->mText.Count();
mImpl->mTextUpdateInfo.mParagraphCharacterIndex = 0u;
mImpl->mTextUpdateInfo.mRequestedNumberOfCharacters = mImpl->mLogicalModel->mText.Count();
- // Store the actual control's width.
- const float actualControlWidth = mImpl->mVisualModel->mControlSize.width;
+ // Store the actual control's size to restore later.
+ const Size actualControlSize = mImpl->mVisualModel->mControlSize;
DoRelayout( Size( MAX_FLOAT, MAX_FLOAT ),
static_cast<OperationsMask>( onlyOnceOperations |
DoRelayout( Size( MAX_FLOAT, MAX_FLOAT ),
static_cast<OperationsMask>( onlyOnceOperations |
// Clear the update info. This info will be set the next time the text is updated.
mImpl->mTextUpdateInfo.Clear();
// Clear the update info. This info will be set the next time the text is updated.
mImpl->mTextUpdateInfo.Clear();
- // Restore the actual control's width.
- mImpl->mVisualModel->mControlSize.width = actualControlWidth;
+ // Restore the actual control's size.
+ mImpl->mVisualModel->mControlSize = actualControlSize;
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::GetNaturalSize calculated %f,%f,%f\n", naturalSize.x, naturalSize.y, naturalSize.z );
}
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::GetNaturalSize calculated %f,%f,%f\n", naturalSize.x, naturalSize.y, naturalSize.z );
}
-void TextScroller::SetGap( float gap )
+void TextScroller::SetGap( int gap )
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetGap gap[%f]\n", gap );
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetGap gap[%d]\n", gap );
-float TextScroller::GetGap() const
+int TextScroller::GetGap() const
mScrollDeltaIndex( Property::INVALID_INDEX ),
mScrollSpeed( MINIMUM_SCROLL_SPEED ),
mLoopCount( 1 ),
mScrollDeltaIndex( Property::INVALID_INDEX ),
mScrollSpeed( MINIMUM_SCROLL_SPEED ),
mLoopCount( 1 ),
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller Default Constructor\n" );
}
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller Default Constructor\n" );
}
mOffscreenCameraActor.SetY( offScreenSize.height * 0.5f );
mOffscreenCameraActor.SetY( offScreenSize.height * 0.5f );
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters mWrapGap[%f]\n", mWrapGap )
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters mWrapGap[%d]\n", mWrapGap )
mScrollingTextActor = Actor::New();
mScrollingTextActor.AddRenderer( renderer );
mScrollingTextActor = Actor::New();
mScrollingTextActor.AddRenderer( renderer );
* @brief Set the gap distance to elapse before the text wraps around
* @param[in] gap distance to elapse
*/
* @brief Set the gap distance to elapse before the text wraps around
* @param[in] gap distance to elapse
*/
- void SetGap( float gap );
+ void SetGap( int gap );
- * @brief Get the distance before scrolling waps
+ * @brief Get the distance before scrolling wraps
* @return gap distance to elapse
*/
* @return gap distance to elapse
*/
/**
* @brief Set speed the text should scroll
/**
* @brief Set speed the text should scroll
Property::Index mScrollDeltaIndex; // Property used by shader to represent distance to scroll
Animation mScrollAnimation; // Animation used to update the mScrollDeltaIndex
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
- float 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
+ int mWrapGap; ///< Gap before text wraps around when scrolling