RelayoutParameters::RelayoutParameters()
: mPositionOffset(),
- mLineSize(),
+ mParagraphSize(),
mWordSize(),
mCharacterSize(),
mIndices(),
mIsFirstCharacter( false ),
mIsFirstCharacterOfWord( false ),
mIsNewLine( false ),
- mIsNewLineCharacter( false ),
+ mIsNewParagraphCharacter( false ),
mIsWhiteSpace( false ),
mIsVisible( false )
{
{
}
-SubLineLayoutInfo::SubLineLayoutInfo()
+LineLayoutInfo::LineLayoutInfo()
: mLineLength( 0.f ),
mMaxCharHeight( 0.f ),
mMaxAscender( 0.f )
{
}
-SubLineLayoutInfo::~SubLineLayoutInfo()
+LineLayoutInfo::~LineLayoutInfo()
{
}
* @param[out] lineLength The length of the portion of line which doesn't exceed the parant's width
* @param[out] endWhiteSpaceLength The length of white spaces which are at the end of the line.
*/
-void CalculateLineLength( const bool isWhiteSpace, const float width, const float parentWidth, bool& found, float& lineLength, float& endWhiteSpaceLength )
+void CalculateLineLength( bool isWhiteSpace, float width, float parentWidth, bool& found, float& lineLength, float& endWhiteSpaceLength )
{
if( lineLength + width > parentWidth )
{
currentTextActorInfo.textActor.SetBlendMode( !visualParameters.mSnapshotModeEnabled ? BlendingMode::ON : BlendingMode::OFF );
}
-void CalculateSubLineLayout( const float parentWidth,
- const TextViewProcessor::TextInfoIndices& indices,
- const TextViewProcessor::LineLayoutInfo& lineLayoutInfo,
- const HorizontalWrapType splitPolicy,
- const float shrinkFactor,
- SubLineLayoutInfo& subLineInfo )
+void CalculateLineLayout( float parentWidth,
+ const TextViewProcessor::TextInfoIndices& indices,
+ const TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo,
+ HorizontalWrapType splitPolicy,
+ float shrinkFactor,
+ LineLayoutInfo& subLineInfo )
{
subLineInfo.mLineLength = 0.f;
subLineInfo.mMaxCharHeight = 0.f;
float lineOffset = 0.f;
bool found = false;
bool isFirstCharacter = true;
- for( TextViewProcessor::WordLayoutInfoContainer::const_iterator wordIt = lineLayoutInfo.mWordsLayoutInfo.begin() + indices.mWordIndex,
- wordEndIt = lineLayoutInfo.mWordsLayoutInfo.end();
+ for( TextViewProcessor::WordLayoutInfoContainer::const_iterator wordIt = paragraphLayoutInfo.mWordsLayoutInfo.begin() + indices.mWordIndex,
+ wordEndIt = paragraphLayoutInfo.mWordsLayoutInfo.end();
( wordIt != wordEndIt ) && !found;
++wordIt )
{
break;
}
case WrapByWord:
- case WrapByLine: // Fall through
+ case WrapByParagraphCharacter: // Fall through
{
splitByCharacter = false;
break;
splitByCharacter = ( shrunkWordWidth > parentWidth );
break;
}
- case WrapByLineAndSplit:
+ case WrapByParagraphCharacterAndSplit:
{
if( ( 0u != characterIndex ) ||
( ( 0u == characterIndex ) && ( lineOffset + shrunkWordWidth > parentWidth ) ) )
subLineInfo.mMaxAscender *= shrinkFactor;
}
-float CalculateXoffset( const Toolkit::Alignment::Type horizontalTextAlignment, const float parentWidth, const float wholeTextWidth )
+float CalculateXoffset( Toolkit::Alignment::Type horizontalTextAlignment, float parentWidth, float wholeTextWidth )
{
float xOffset( 0.f );
switch( horizontalTextAlignment )
return xOffset;
}
-float CalculateYoffset( const Toolkit::Alignment::Type verticalTextAlignment, const float parentHeight, const float wholeTextHeight )
+float CalculateYoffset( Toolkit::Alignment::Type verticalTextAlignment, float parentHeight, float wholeTextHeight )
{
float yOffset( 0.f );
switch( verticalTextAlignment )
return yOffset;
}
-float CalculateJustificationOffset( const Toolkit::TextView::LineJustification justification, const float wholeTextWidth, const float lineLength )
+float CalculateJustificationOffset( Toolkit::TextView::LineJustification justification, float wholeTextWidth, float lineLength )
{
float offset = 0.f;
switch( justification )
return offset;
}
-bool IsVisible( const Vector3& position, const Size& size, const Size& parentSize, const VisibilityTestType type )
+bool IsVisible( const Vector3& position, const Size& size, const Size& parentSize, VisibilityTestType type )
{
bool visible = false;
std::size_t lineJustificationIndex = 0u; // Index to the first position of the vector which stores all line justification info.
std::size_t infoTableCharacterIndex = 0u;
- relayoutParameters.mIndices.mLineIndex = 0u;
+ relayoutParameters.mIndices.mParagraphIndex = 0u;
- for( TextViewProcessor::LineLayoutInfoContainer::iterator lineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(),
- endLineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
- lineLayoutIt != endLineLayoutIt;
- ++lineLayoutIt, ++relayoutParameters.mIndices.mLineIndex )
+ for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(),
+ endParagraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+ paragraphLayoutIt != endParagraphLayoutIt;
+ ++paragraphLayoutIt, ++relayoutParameters.mIndices.mParagraphIndex )
{
- TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *lineLayoutIt );
+ TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *paragraphLayoutIt );
float justificationOffset = 0.f;
relayoutParameters.mIndices.mWordIndex = 0u;
- for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = lineLayoutInfo.mWordsLayoutInfo.begin(),
- endWordLayoutIt = lineLayoutInfo.mWordsLayoutInfo.end();
+ for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.begin(),
+ endWordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.end();
wordLayoutIt != endWordLayoutIt;
++wordLayoutIt, ++relayoutParameters.mIndices.mWordIndex )
{
positionOffset.x += characterLayoutInfo.mAdvance * relayoutData.mShrinkFactor;
} // end characters
} // end words
- } // end lines
+ } // end paragraphs
}
void CalculateBearing( TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo,
const Toolkit::TextView::CharacterLayoutInfo characterLayoutTableInfo( Size( characterLayoutInfo.mAdvance * relayoutData.mShrinkFactor,
characterLayoutInfo.mHeight * relayoutData.mShrinkFactor ),
positionOffset,
- ( TextViewProcessor::LineSeparator == wordLayoutInfo.mType ),
+ ( TextViewProcessor::ParagraphSeparator == wordLayoutInfo.mType ),
false, // VCC set the correct direction if needed.
true,
descender );
EllipsizeParameters& ellipsizeParameters,
TextView::RelayoutData& relayoutData )
{
- // Traverses the text layout info from the first character of the laid out line
+ // Traverses the text layout info from the first character of the line
// to the last one setting to each character its visibility. If needed, it adds the ellipsize text (...).
- // Indices to the first character of the laid out line.
+ // Indices to the first character of the line.
TextViewProcessor::TextInfoIndices firstIndices;
TextViewProcessor::GetIndicesFromGlobalCharacterIndex( ellipsizeParameters.mFirstIndex,
relayoutData.mTextLayoutInfo,
firstIndices );
- // Indices to the last character of the laid out line.
+ // Indices to the last character of the line.
TextViewProcessor::TextInfoIndices lastIndices;
TextViewProcessor::GetIndicesFromGlobalCharacterIndex( ellipsizeParameters.mLastIndex,
relayoutData.mTextLayoutInfo,
ellipsizeParameters.mEllipsizeBoundary = relayoutData.mTextViewSize;
ellipsizeParameters.mEllipsizeBoundary.width -= relayoutData.mTextLayoutInfo.mEllipsizeLayoutInfo.mSize.width;
- for( TextViewProcessor::LineLayoutInfoContainer::iterator lineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + firstIndices.mLineIndex,
- endLineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + lastIndices.mLineIndex + 1u;
- lineLayoutIt != endLineLayoutIt;
- ++lineLayoutIt )
+ for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + firstIndices.mParagraphIndex,
+ endParagraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + lastIndices.mParagraphIndex + 1u;
+ paragraphLayoutIt != endParagraphLayoutIt;
+ ++paragraphLayoutIt )
{
- TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *lineLayoutIt );
+ TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *paragraphLayoutIt );
ellipsizeParameters.mLineFits = ellipsizeParameters.mIsLineWidthFullyVisible && ellipsizeParameters.mIsLineHeightFullyVisible && ellipsizeParameters.mIsNextLineFullyVisibleHeight;
std::size_t wordCount = 0u;
- for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = lineLayoutInfo.mWordsLayoutInfo.begin() + firstIndices.mWordIndex,
- endWordLayoutIt = lineLayoutInfo.mWordsLayoutInfo.begin() + lastIndices.mWordIndex + 1u;
+ for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.begin() + firstIndices.mWordIndex,
+ endWordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.begin() + lastIndices.mWordIndex + 1u;
wordLayoutIt != endWordLayoutIt;
++wordLayoutIt, ++wordCount )
{
} // end characters
firstWord = false;
} // end words
- } // end lines
+ } // end paragraphs
}
void SetTextVisible( TextView::RelayoutData& relayoutData )
{
- for( TextViewProcessor::LineLayoutInfoContainer::iterator lineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(),
- endLineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
- lineLayoutIt != endLineLayoutIt;
- ++lineLayoutIt )
+ for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(),
+ endParagraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+ paragraphLayoutIt != endParagraphLayoutIt;
+ ++paragraphLayoutIt )
{
- TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *lineLayoutIt );
+ TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *paragraphLayoutIt );
- for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = lineLayoutInfo.mWordsLayoutInfo.begin(),
- endWordLayoutIt = lineLayoutInfo.mWordsLayoutInfo.end();
+ for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.begin(),
+ endWordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.end();
wordLayoutIt != endWordLayoutIt;
++wordLayoutIt )
{
characterLayoutInfo.mColorAlpha = characterLayoutInfo.mStyledText.mStyle.GetTextColor().a;
} // end characters
} // end words
- } // end lines
+ } // end paragraphs
// Updates the visibility for text-input..
for( std::vector<Toolkit::TextView::CharacterLayoutInfo>::iterator it = relayoutData.mCharacterLayoutInfoTable.begin(),
std::size_t infoTableCharacterIndex = 0u;
- relayoutParameters.mIndices.mLineIndex = 0u;
+ relayoutParameters.mIndices.mParagraphIndex = 0u;
- for( TextViewProcessor::LineLayoutInfoContainer::iterator lineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(),
- endLineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
- lineLayoutIt != endLineLayoutIt;
- ++lineLayoutIt, ++relayoutParameters.mIndices.mLineIndex )
+ for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(),
+ endParagraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+ paragraphLayoutIt != endParagraphLayoutIt;
+ ++paragraphLayoutIt, ++relayoutParameters.mIndices.mParagraphIndex )
{
- TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *lineLayoutIt );
+ TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *paragraphLayoutIt );
relayoutParameters.mIndices.mWordIndex = 0u;
- for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = lineLayoutInfo.mWordsLayoutInfo.begin(),
- endWordLayoutIt = lineLayoutInfo.mWordsLayoutInfo.end();
+ for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.begin(),
+ endWordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.end();
wordLayoutIt != endWordLayoutIt;
++wordLayoutIt, ++relayoutParameters.mIndices.mWordIndex )
{
relayoutParameters.mIsFirstCharacterOfWord = false;
} // end character
} // end words
- } // end lines
+ } // end paragraphs
}
void UpdateVisibilityForEllipsize( const TextView::LayoutParameters& layoutParameters,
const TextView::VisualParameters& visualParameters,
TextView::RelayoutData& relayoutData )
{
- // Traverses the laid-out lines and checks which ones doesn't fit in the text-view's boundary.
+ // Traverses the lines and checks which ones doesn't fit in the text-view's boundary.
for( Toolkit::TextView::LineLayoutInfoContainer::const_iterator lineInfoIt = relayoutData.mLines.begin(), endLineInfoIt = relayoutData.mLines.end();
lineInfoIt != endLineInfoIt;
++lineInfoIt )
{
const Toolkit::TextView::LineLayoutInfo& lineInfo( *lineInfoIt );
- // To check if a laid-out line fits in the text-view's boundary,
+ // To check if a line fits in the text-view's boundary,
// get the position of the first character is needed and do the test
- // with the laid-out line size.
+ // with the line size.
// An bearing offset may have been applied to the first character so it's needed to
// get the start position of the line.
*
* @param[in] visualParameters Some visual parameters (fade, sort modifier and blending).
* @param[in,out] relayoutData Natural size (metrics), layout, text-actor info.
- * @param[in,out] line Layout info for the line.
+ * @param[in,out] paragraph Layout info for the paragraph.
* @param[in,out] characterLayout Layout info for the character.
* @param[in] character The character.
* @param[in] style The character's style.
*/
void CreateTextActor( const TextView::VisualParameters& visualParameters,
TextView::RelayoutData& relayoutData,
- const TextViewProcessor::LineLayoutInfo& line,
+ const TextViewProcessor::ParagraphLayoutInfo& paragraph,
TextViewProcessor::CharacterLayoutInfo& characterLayout,
const Character& character,
const TextStyle& style,
SetVisualParameters( currentTextActorInfo,
visualParameters,
relayoutData,
- line.mSize.height );
+ paragraph.mSize.height );
}
currentTextActorInfo.text = Text( character );
}
/**
- * Traverses the whole line initializating renderable-actor handles and updating them with the new size and position.
+ * Traverses the whole paragraph initializating renderable-actor handles and updating them with the new size and position.
*
* @param[in] visualParameters Some visual parameters (fade, sort modifier and blending).
* @param[in,out] relayoutData Natural size (metrics), layout, text-actor info.
- * @param[in,out] line Layout info for the line.
+ * @param[in,out] paragraph Layout info for the paragraph.
* @param[in,out] characterGlobalIndex Index to the character within the whole text.
- * @param[in,out] lineLayoutInfoIndex Index to the table of laid out lines.
+ * @param[in,out] lineLayoutInfoIndex Index to the table of lines.
* @param[in,out] createGlyphActors Whether to initialize renderable-actor handles.
*/
-void UpdateTextActorInfoForLine( const TextView::VisualParameters& visualParameters,
- TextView::RelayoutData& relayoutData,
- TextViewProcessor::LineLayoutInfo& line,
- std::size_t& characterGlobalIndex,
- std::size_t& lineLayoutInfoIndex,
- bool createGlyphActors )
+void UpdateTextActorInfoForParagraph( const TextView::VisualParameters& visualParameters,
+ TextView::RelayoutData& relayoutData,
+ TextViewProcessor::ParagraphLayoutInfo& paragraph,
+ std::size_t& characterGlobalIndex,
+ std::size_t& lineLayoutInfoIndex,
+ bool createGlyphActors )
{
CurrentTextActorInfo currentTextActorInfo;
- const std::size_t lineLayoutInfoSize = relayoutData.mLines.size(); // Number of laid out lines.
- bool lineLayoutEnd = false; // Whether lineLayoutInfoIndex points at the last laid out line.
+ const std::size_t lineLayoutInfoSize = relayoutData.mLines.size(); // Number of lines.
+ bool lineLayoutEnd = false; // Whether lineLayoutInfoIndex points at the last line.
bool glyphActorCreatedForLine = false; // Whether a renderable actor has been created for this line.
TextStyle currentStyle; // style for the current text-actor.
std::vector<TextActor> textActorsToRemove; // Keep a vector of text-actors to be included into the cache.
- std::size_t characterLineIndex = 0u; // Index to the character (within the line).
- for( TextViewProcessor::WordLayoutInfoContainer::iterator wordIt = line.mWordsLayoutInfo.begin(), wordEndIt = line.mWordsLayoutInfo.end();
+ std::size_t characterParagraphIndex = 0u; // Index to the character (within the paragraph).
+ for( TextViewProcessor::WordLayoutInfoContainer::iterator wordIt = paragraph.mWordsLayoutInfo.begin(), wordEndIt = paragraph.mWordsLayoutInfo.end();
wordIt != wordEndIt;
++wordIt )
{
bool appendCharacter = false;
if( characterLayout.mIsColorGlyph ||
- !character.IsWhiteSpace() || // A new line character is also a white space.
+ !character.IsWhiteSpace() || // A new paragraph character is also a white space.
( character.IsWhiteSpace() && style.IsUnderlineEnabled() ) )
{
- // Do not create a glyph-actor if it's a white space (without underline) or a new line character.
+ // Do not create a glyph-actor if it's a white space (without underline) or a new paragraph character.
// Creates one glyph-actor for each counsecutive group of characters, with the same style, per line, or if it's an emoticon.
{
CreateTextActor( visualParameters,
relayoutData,
- line,
+ paragraph,
characterLayout,
character,
style,
characterLayout.mGlyphActor.Reset();
}
}
- } // no white space / new line char
+ } // no white space / new paragraph char
else
{
appendCharacter = true;
if( appendCharacter )
{
// Add the character to the current text-actor and update the size.
- if( characterLayout.mIsVisible && ( TextViewProcessor::LineSeparator != word.mType ) )
+ if( characterLayout.mIsVisible && ( TextViewProcessor::ParagraphSeparator != word.mType ) )
{
currentTextActorInfo.text.Append( character );
}
++characterGlobalIndex;
- ++characterLineIndex;
+ ++characterParagraphIndex;
} // characters
} // words
SetVisualParameters( currentTextActorInfo,
visualParameters,
relayoutData,
- line.mSize.height );
+ paragraph.mSize.height );
}
}
TextView::RelayoutData& relayoutData,
bool createGlyphActors )
{
- if( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.empty() )
+ if( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.empty() )
{
- // nothing to do if there is no lines.
+ // nothing to do if there is no paragraphs.
return;
}
std::size_t characterGlobalIndex = 0u; // Index to the global character (within the whole text).
- std::size_t lineLayoutInfoIndex = 0u; // Index to the laid out line info.
+ std::size_t lineLayoutInfoIndex = 0u; // Index to the line info.
- for( TextViewProcessor::LineLayoutInfoContainer::iterator lineIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(), lineEndIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
- lineIt != lineEndIt;
- ++lineIt )
+ for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(), paragraphEndIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+ paragraphIt != paragraphEndIt;
+ ++paragraphIt )
{
- TextViewProcessor::LineLayoutInfo& line( *lineIt );
+ TextViewProcessor::ParagraphLayoutInfo& paragraph( *paragraphIt );
- UpdateTextActorInfoForLine( visualParameters,
- relayoutData,
- line,
- characterGlobalIndex,
- lineLayoutInfoIndex,
- createGlyphActors );
- } // lines
+ UpdateTextActorInfoForParagraph( visualParameters,
+ relayoutData,
+ paragraph,
+ characterGlobalIndex,
+ lineLayoutInfoIndex,
+ createGlyphActors );
+ } // paragraphs
for( std::vector<RenderableActor>::iterator it = relayoutData.mEllipsizedGlyphActors.begin(),
endIt = relayoutData.mEllipsizedGlyphActors.end();
void CalculateUnderlineInfo( TextView::RelayoutData& relayoutData, TextViewRelayout::TextUnderlineStatus& textUnderlineStatus )
{
- // Traverse the whole text to find all groups of consecutive underlined characters in the same laid-out line.
+ // Traverse the whole text to find all groups of consecutive underlined characters in the same line.
//
- // Note that relayoutData.mTextLayoutInfo contains layout info per line but these lines are the result of split the whole text every time a '\n' is found.
- // According with the layout option, one of this lines could be laid-out in more than one.
+ // Note that relayoutData.mTextLayoutInfo contains layout info per paragraph but these paragraphs are the result of split the whole text every time a '\n' is found.
+ // According with the layout option, one of this paragraphs could be laid-out in more than one line.
- for( TextViewProcessor::LineLayoutInfoContainer::iterator lineIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(), lineEndIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
- lineIt != lineEndIt;
- ++lineIt )
+ for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(), paragraphEndIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+ paragraphIt != paragraphEndIt;
+ ++paragraphIt )
{
- TextViewProcessor::LineLayoutInfo& line( *lineIt );
+ TextViewProcessor::ParagraphLayoutInfo& paragraph( *paragraphIt );
- for( TextViewProcessor::WordLayoutInfoContainer::iterator wordIt = line.mWordsLayoutInfo.begin(), wordEndIt = line.mWordsLayoutInfo.end();
+ for( TextViewProcessor::WordLayoutInfoContainer::iterator wordIt = paragraph.mWordsLayoutInfo.begin(), wordEndIt = paragraph.mWordsLayoutInfo.end();
wordIt != wordEndIt;
++wordIt )
{
{
TextViewProcessor::CharacterLayoutInfo& character( *characterIt );
- // Check if current character is the first of a new laid-out line
+ // Check if current character is the first of a new line
const bool isNewLine = ( textUnderlineStatus.mLineGlobalIndex < relayoutData.mLines.size() ) &&
( textUnderlineStatus.mCharacterGlobalIndex == ( *( relayoutData.mLines.begin() + textUnderlineStatus.mLineGlobalIndex ) ).mCharacterGlobalIndex );
if( isNewLine )
if( character.mStyledText.mStyle.IsUnderlineEnabled() )
{
if( !textUnderlineStatus.mCurrentUnderlineStatus || // Current character is underlined but previous one it wasn't.
- isNewLine ) // Current character is underlined and is the first of current laid-out line.
+ isNewLine ) // Current character is underlined and is the first of current line.
{
// Create a new underline info for the current underlined characters.
UnderlineInfo underlineInfo;
++textUnderlineStatus.mCharacterGlobalIndex;
} // end characters.
} // end words.
- } // end lines.
+ } // end paragraphs.
}
void SetUnderlineInfo( TextView::RelayoutData& relayoutData )
{
- // Stores for each group of consecutive underlined characters in each laid-out line its maximum thicknes, its position of that thickness and the maximum character's height.
+ // Stores for each group of consecutive underlined characters in each line its maximum thicknes, its position of that thickness and the maximum character's height.
TextViewRelayout::TextUnderlineStatus textUnderlineStatus;
- // Traverse the whole text to find all groups of consecutive underlined characters in the same laid-out line.
+ // Traverse the whole text to find all groups of consecutive underlined characters in the same line.
CalculateUnderlineInfo( relayoutData, textUnderlineStatus );
if( textUnderlineStatus.mUnderlineInfo.empty() )
float currentLineHeight = 0.f;
float currentLineAscender = 0.f;
- for( TextViewProcessor::LineLayoutInfoContainer::iterator lineIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(), lineEndIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
- lineIt != lineEndIt;
- ++lineIt )
+ for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(), paragraphEndIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+ paragraphIt != paragraphEndIt;
+ ++paragraphIt )
{
- TextViewProcessor::LineLayoutInfo& line( *lineIt );
+ TextViewProcessor::ParagraphLayoutInfo& paragraph( *paragraphIt );
- for( TextViewProcessor::WordLayoutInfoContainer::iterator wordIt = line.mWordsLayoutInfo.begin(), wordEndIt = line.mWordsLayoutInfo.end();
+ for( TextViewProcessor::WordLayoutInfoContainer::iterator wordIt = paragraph.mWordsLayoutInfo.begin(), wordEndIt = paragraph.mWordsLayoutInfo.end();
wordIt != wordEndIt;
++wordIt )
{
{
TextViewProcessor::CharacterLayoutInfo& character( *characterIt );
- // Check if current character is the first of a new laid-out line
+ // Check if current character is the first of a new line
bool isNewLine = false;
++textUnderlineStatus.mCharacterGlobalIndex;
} // end of characters.
} // end of word.
- } // end of lines.
+ } // end of paragraphs.
}
void RemoveGlyphActors( Actor textView,
{
// Add text-actors to the text-view.
- for( TextViewProcessor::LineLayoutInfoContainer::iterator lineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(),
- endLineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
- lineLayoutIt != endLineLayoutIt;
- ++lineLayoutIt )
+ for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(),
+ endParagraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+ paragraphLayoutIt != endParagraphLayoutIt;
+ ++paragraphLayoutIt )
{
- TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *lineLayoutIt );
+ TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *paragraphLayoutIt );
- for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = lineLayoutInfo.mWordsLayoutInfo.begin(),
- endWordLayoutIt = lineLayoutInfo.mWordsLayoutInfo.end();
+ for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.begin(),
+ endWordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.end();
wordLayoutIt != endWordLayoutIt;
++wordLayoutIt )
{
}
} // end character
} // end words
- } // end lines
+ } // end paragraphs
for( std::vector<RenderableActor>::iterator it = relayoutData.mEllipsizedGlyphActors.begin(),
endIt = relayoutData.mEllipsizedGlyphActors.end();