+ if( ( nextIndex == layoutParameters.totalNumberOfGlyphs ) &&
+ layoutParameters.isLastNewParagraph &&
+ ( mLayout == MULTI_LINE_BOX ) )
+ {
+ // The last character of the text is a new paragraph character.
+ // An extra line with no characters is added to increase the text's height
+ // in order to place the cursor.
+
+ if( numberOfLines == linesCapacity )
+ {
+ // Reserve more space for the next lines.
+ linesBuffer = ResizeLinesBuffer( lines,
+ newLines,
+ linesCapacity,
+ updateCurrentBuffer );
+ }
+
+ UpdateTextLayout( layoutParameters,
+ layout.characterIndex + layout.numberOfCharacters,
+ index + layout.numberOfGlyphs,
+ layoutSize,
+ linesBuffer,
+ numberOfLines );
+ } // whether to add a last line.
+
+ // Sets the positions of the glyphs.
+ SetGlyphPositions( layoutParameters.glyphsBuffer + index,
+ layout.numberOfGlyphs,
+ glyphPositionsBuffer + index - layoutParameters.startGlyphIndex );
+
+ // Updates the vertical pen's position.
+ penY += -layout.descender;
+
+ // Increase the glyph index.
+ index = nextIndex;
+ } // no ellipsis
+ } // end for() traversing glyphs.
+
+ if( updateCurrentBuffer )
+ {
+ glyphPositions.Insert( glyphPositions.Begin() + layoutParameters.startGlyphIndex,
+ newGlyphPositions.Begin(),
+ newGlyphPositions.End() );
+ glyphPositions.Resize( layoutParameters.totalNumberOfGlyphs );
+
+ newLines.Resize( numberOfLines );
+
+ // Current text's layout size adds only the newly laid-out lines.
+ // Updates the layout size with the previously laid-out lines.
+ UpdateLayoutSize( lines,
+ layoutSize );
+
+ if( 0u != newLines.Count() )