relayoutParameters.mPositionOffset = Vector3::ZERO;
relayoutParameters.mIsFirstCharacter = true;
- relayoutParameters.mIndices.mLineIndex = 0;
- relayoutParameters.mCharacterGlobalIndex = 0;
+ relayoutParameters.mIndices.mLineIndex = 0u;
+ relayoutParameters.mCharacterGlobalIndex = 0u;
for( TextViewProcessor::LineLayoutInfoContainer::iterator lineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(),
endLineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
relayoutParameters.mIsNewLine = true;
relayoutParameters.mLineSize = lineLayoutInfo.mSize;
- relayoutParameters.mIndices.mGroupIndex = 0;
+ relayoutParameters.mIndices.mWordIndex = 0u;
- for( TextViewProcessor::WordGroupLayoutInfoContainer::iterator groupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.begin(),
- endGroupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.end();
- groupLayoutIt != endGroupLayoutIt;
- ++groupLayoutIt, ++relayoutParameters.mIndices.mGroupIndex )
+ for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = lineLayoutInfo.mWordsLayoutInfo.begin(),
+ endWordLayoutIt = lineLayoutInfo.mWordsLayoutInfo.end();
+ wordLayoutIt != endWordLayoutIt;
+ ++wordLayoutIt, ++relayoutParameters.mIndices.mWordIndex )
{
- TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo( *groupLayoutIt );
-
- relayoutParameters.mIndices.mWordIndex = 0;
-
- for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.begin(),
- endWordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.end();
- wordLayoutIt != endWordLayoutIt;
- ++wordLayoutIt, ++relayoutParameters.mIndices.mWordIndex )
+ TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
+ relayoutParameters.mIsWhiteSpace = TextViewProcessor::WordSeparator == wordLayoutInfo.mType;
+ relayoutParameters.mIsNewLineCharacter = TextViewProcessor::LineSeparator == wordLayoutInfo.mType;
+
+ relayoutParameters.mIsFirstCharacterOfWord = true;
+ relayoutParameters.mWordSize = wordLayoutInfo.mSize;
+ relayoutParameters.mIndices.mCharacterIndex = 0u;
+
+ for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
+ endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.end();
+ characterLayoutIt != endCharacterLayoutIt;
+ ++characterLayoutIt, ++relayoutParameters.mIndices.mCharacterIndex )
{
- TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
- relayoutParameters.mIsWhiteSpace = TextViewProcessor::WordSeparator == wordLayoutInfo.mType;
- relayoutParameters.mIsNewLineCharacter = TextViewProcessor::LineSeparator == wordLayoutInfo.mType;
-
- relayoutParameters.mIsFirstCharacterOfWord = true;
- relayoutParameters.mWordSize = wordLayoutInfo.mSize;
- relayoutParameters.mIndices.mCharacterIndex = 0;
-
- for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
- endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.end();
- characterLayoutIt != endCharacterLayoutIt;
- ++characterLayoutIt, ++relayoutParameters.mIndices.mCharacterIndex )
- {
- TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
+ TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
- relayoutParameters.mCharacterSize = characterLayoutInfo.mSize;
+ relayoutParameters.mCharacterSize = characterLayoutInfo.mSize;
- switch( layoutParameters.mExceedPolicy )
+ switch( layoutParameters.mExceedPolicy )
+ {
+ case TextView::OriginalShrink:
+ case TextView::SplitOriginal:
+ case TextView::SplitFade:
+ case TextView::SplitEllipsizeEnd:
+ case TextView::SplitShrink:
+ case TextView::ShrinkOriginal:
+ case TextView::ShrinkFade:
+ case TextView::Shrink:
+ case TextView::EllipsizeEndOriginal:
+ case TextView::EllipsizeEnd: // Fall Through
{
- case TextView::OriginalShrink:
- case TextView::SplitOriginal:
- case TextView::SplitFade:
- case TextView::SplitEllipsizeEnd:
- case TextView::SplitShrink:
- case TextView::ShrinkOriginal:
- case TextView::ShrinkFade:
- case TextView::Shrink:
- case TextView::EllipsizeEndOriginal:
- case TextView::EllipsizeEnd: // Fall Through
- {
- DALI_LOG_WARNING( "SplitByChar::CalculateSizeAndPosition() policy not implemented.\n" );
- break;
- }
- case TextView::OriginalFade:
- case TextView::FadeOriginal:
- case TextView::Original:
- case TextView::Fade: // Fall Through
- {
- characterLayoutInfo.mPosition = NoShrinkWhenExceedPosition( relayoutParameters,
- layoutParameters,
- relayoutData );
-
- relayoutParameters.mPositionOffset = characterLayoutInfo.mPosition + Vector3( characterLayoutInfo.mSize.width, 0.f, 0.f );
- break;
- }
- default:
- {
- DALI_LOG_WARNING( "SplitByChar::CalculateSizeAndPosition() policy combination not possible.\n" );
- }
+ DALI_LOG_WARNING( "SplitByChar::CalculateSizeAndPosition() policy not implemented.\n" );
+ break;
}
+ case TextView::OriginalFade:
+ case TextView::FadeOriginal:
+ case TextView::Original:
+ case TextView::Fade: // Fall Through
+ {
+ characterLayoutInfo.mPosition = NoShrinkWhenExceedPosition( relayoutParameters,
+ layoutParameters,
+ relayoutData );
- // Get last line info and calculate the bearing (used to align glyphs with the baseline).
- TextViewRelayout::CalculateBearing( characterLayoutInfo, relayoutData );
-
- // updates min and max position to calculate the text size for split by char.
- TextViewRelayout::UpdateLayoutInfoTable( minMaxXY,
- wordGroupLayoutInfo,
- wordLayoutInfo,
- characterLayoutInfo,
- relayoutParameters,
- relayoutData );
-
- ++relayoutParameters.mCharacterGlobalIndex;
- relayoutParameters.mIsFirstCharacter = false;
- relayoutParameters.mIsNewLine = false;
- } // end characters
- } // end words
- } // end group of words
+ relayoutParameters.mPositionOffset = characterLayoutInfo.mPosition + Vector3( characterLayoutInfo.mSize.width, 0.f, 0.f );
+ break;
+ }
+ default:
+ {
+ DALI_LOG_WARNING( "SplitByChar::CalculateSizeAndPosition() policy combination not possible.\n" );
+ }
+ }
+
+ // Get last line info and calculate the bearing (used to align glyphs with the baseline).
+ TextViewRelayout::CalculateBearing( characterLayoutInfo, relayoutData );
+
+ // updates min and max position to calculate the text size for split by char.
+ TextViewRelayout::UpdateLayoutInfoTable( minMaxXY,
+ wordLayoutInfo,
+ characterLayoutInfo,
+ relayoutParameters,
+ relayoutData );
+
+ ++relayoutParameters.mCharacterGlobalIndex;
+ relayoutParameters.mIsFirstCharacter = false;
+ relayoutParameters.mIsNewLine = false;
+ } // end characters
+ } // end words
} // end lines
if( relayoutData.mCharacterLayoutInfoTable.empty() )
// Check if the last character is a new line character. In that case the height should be added.
if( !relayoutData.mTextLayoutInfo.mLinesLayoutInfo.empty() )
{
- const TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end() - 1 ) );
+ const TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end() - 1u ) );
- if( lineLayoutInfo.mWordGroupsLayoutInfo.empty() ) // if it's empty, it means the last character is a new line character.
+ if( lineLayoutInfo.mWordsLayoutInfo.empty() ) // if it's empty, it means the last character is a new line character.
{
relayoutData.mTextSizeForRelayoutOption.height += lineLayoutInfo.mSize.height;
}
relayoutData );
}
- if( relayoutOperationMask & TextView::RELAYOUT_INITIALIZE_TEXT_ACTORS )
- {
- TextViewProcessor::InitializeTextActorInfo( relayoutData );
- }
-
- if( relayoutOperationMask & TextView::RELAYOUT_TEXT_ACTOR_UPDATE )
+ const bool initializeTextActors = relayoutOperationMask & TextView::RELAYOUT_INITIALIZE_TEXT_ACTORS;
+ const bool updateTextActors = relayoutOperationMask & TextView::RELAYOUT_TEXT_ACTOR_UPDATE;
+ if( initializeTextActors || updateTextActors )
{
TextViewRelayout::UpdateTextActorInfo( visualParameters,
- relayoutData );
+ relayoutData,
+ initializeTextActors );
}
- if( ( relayoutOperationMask & TextView::RELAYOUT_INSERT_TO_TEXT_VIEW ) ||
- ( relayoutOperationMask & TextView::RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST ) )
+ if( relayoutOperationMask & TextView::RELAYOUT_INSERT_TO_TEXT_VIEW )
{
- TextViewRelayout::InsertToTextView( relayoutOperationMask,
- textView,
+ TextViewRelayout::InsertToTextView( textView,
relayoutData );
}
}