-/**
- * Updates the word size and ascender.
- *
- * It's called after deleting some characters.
- *
- * @param[in] wordLayout The word layout info.
- */
-void UpdateLayoutInfo( WordLayoutInfo& wordLayout )
-{
- // Initialize layout info for the whole word.
- wordLayout.mSize = Size();
- wordLayout.mAscender = 0.f;
-
- // Traverse the character layout info to update the word layout.
- for( CharacterLayoutInfoContainer::iterator layoutIt = wordLayout.mCharactersLayoutInfo.begin(), layoutEndIt = wordLayout.mCharactersLayoutInfo.end();
- layoutIt != layoutEndIt;
- ++layoutIt )
- {
- // Layout info for the current character.
- CharacterLayoutInfo& layoutInfo( *layoutIt );
-
- // Update layout info for the current word.
- UpdateSize( wordLayout.mSize, layoutInfo.mSize );
- wordLayout.mAscender = std::max( wordLayout.mAscender, layoutInfo.mAscender );
- }
-}
-