+ // Add extra geometry to 'boxify' the selection.
+
+ if( 1u < numberOfLines )
+ {
+ // Boxify the first line.
+ lineRun = mVisualModel->mLines.Begin() + firstLineIndex;
+ const SelectionBoxInfo& firstSelectionBoxLineInfo = *( selectionBoxLinesInfo.Begin() );
+
+ bool boxifyBegin = ( LTR != lineRun->direction ) && ( LTR != startDirection );
+ bool boxifyEnd = ( LTR == lineRun->direction ) && ( LTR == startDirection );
+
+ if( boxifyBegin )
+ {
+ // Boxify at the beginning of the line.
+ mEventData->mDecorator->AddHighlight( 0.f,
+ firstSelectionBoxLineInfo.lineOffset,
+ firstSelectionBoxLineInfo.minX,
+ firstSelectionBoxLineInfo.lineOffset + firstSelectionBoxLineInfo.lineHeight );
+ }
+
+ if( boxifyEnd )
+ {
+ // Boxify at the end of the line.
+ mEventData->mDecorator->AddHighlight( firstSelectionBoxLineInfo.maxX,
+ firstSelectionBoxLineInfo.lineOffset,
+ mVisualModel->mControlSize.width,
+ firstSelectionBoxLineInfo.lineOffset + firstSelectionBoxLineInfo.lineHeight );
+ }
+
+ // Boxify the central lines.
+ if( 2u < numberOfLines )
+ {
+ for( Vector<SelectionBoxInfo>::ConstIterator it = selectionBoxLinesInfo.Begin() + 1u,
+ endIt = selectionBoxLinesInfo.End() - 1u;
+ it != endIt;
+ ++it )
+ {
+ const SelectionBoxInfo& info = *it;
+
+ mEventData->mDecorator->AddHighlight( 0.f,
+ info.lineOffset,
+ info.minX,
+ info.lineOffset + info.lineHeight );
+
+ mEventData->mDecorator->AddHighlight( info.maxX,
+ info.lineOffset,
+ mVisualModel->mControlSize.width,
+ info.lineOffset + info.lineHeight );
+ }
+ }
+
+ // Boxify the last line.
+ lineRun = mVisualModel->mLines.Begin() + firstLineIndex + numberOfLines - 1u;
+ const SelectionBoxInfo& lastSelectionBoxLineInfo = *( selectionBoxLinesInfo.End() - 1u );
+
+ boxifyBegin = ( LTR == lineRun->direction ) && ( LTR == endDirection );
+ boxifyEnd = ( LTR != lineRun->direction ) && ( LTR != endDirection );
+
+ if( boxifyBegin )
+ {
+ // Boxify at the beginning of the line.
+ mEventData->mDecorator->AddHighlight( 0.f,
+ lastSelectionBoxLineInfo.lineOffset,
+ lastSelectionBoxLineInfo.minX,
+ lastSelectionBoxLineInfo.lineOffset + lastSelectionBoxLineInfo.lineHeight );
+ }
+
+ if( boxifyEnd )
+ {
+ // Boxify at the end of the line.
+ mEventData->mDecorator->AddHighlight( lastSelectionBoxLineInfo.maxX,
+ lastSelectionBoxLineInfo.lineOffset,
+ mVisualModel->mControlSize.width,
+ lastSelectionBoxLineInfo.lineOffset + lastSelectionBoxLineInfo.lineHeight );
+ }
+ }
+
+