X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=base%2Fdali-toolkit%2Finternal%2Fcontrols%2Ftext-input%2Ftext-input-text-highlight-impl.cpp;h=7475678f0e34e12769839c9840727ad083ec2eae;hp=469c0aab44d766af5f3a511240f912c91fd8ad7c;hb=0697056b2ada1017c577c441c1c517ce8c08279f;hpb=63cc283d6ff8e3c2cb849e7070b94a2bc1804693 diff --git a/base/dali-toolkit/internal/controls/text-input/text-input-text-highlight-impl.cpp b/base/dali-toolkit/internal/controls/text-input/text-input-text-highlight-impl.cpp index 469c0aa..7475678 100644 --- a/base/dali-toolkit/internal/controls/text-input/text-input-text-highlight-impl.cpp +++ b/base/dali-toolkit/internal/controls/text-input/text-input-text-highlight-impl.cpp @@ -208,12 +208,15 @@ TextHighlight::HighlightInfo TextHighlight::CalculateHighlightInfo( std::size_t { lastIt = std::max( textLayoutInfo.mCharacterLayoutInfoTable.begin(), lastIt - 1 ); } - const Size rowSize( mTextViewCharacterPositioning.GetRowRectFromCharacterPosition( lastIt - textLayoutInfo.mCharacterLayoutInfoTable.begin(), min, max ) ); - maxRowLeft = std::min(maxRowLeft, min.x); - maxRowRight = std::max(maxRowRight, max.x); - float rowBottom = lastIt->mPosition.y - textLayoutInfo.mScrollOffset.y; - float rowTop = rowBottom - rowSize.height; - newHighlightInfo.AddQuad( rowLeft, rowTop, rowRight, rowBottom ); + if( lastIt != end ) + { + const Size rowSize( mTextViewCharacterPositioning.GetRowRectFromCharacterPosition( lastIt - textLayoutInfo.mCharacterLayoutInfoTable.begin(), min, max ) ); + maxRowLeft = std::min(maxRowLeft, min.x); + maxRowRight = std::max(maxRowRight, max.x); + float rowBottom = lastIt->mPosition.y - textLayoutInfo.mScrollOffset.y; + float rowTop = rowBottom - rowSize.height; + newHighlightInfo.AddQuad( rowLeft, rowTop, rowRight, rowBottom ); + } } }