From e3e50bf7ed48c6ee0a199d27fce7ba888793429d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 23 Mar 2010 12:47:11 -0700 Subject: added some comments for fix to EXT-5549 --- indra/llui/lltextbase.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index f0b3a1a56c..5f4b16ec9e 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -363,7 +363,10 @@ void LLTextBase::drawSelectionBackground() selection_rect.mLeft += segment_width; } - // if selection spans end of current segment... + // if selection_right == segment_line_end then that means we are the first character of the next segment + // or first character of the next line, in either case we want to add the length of the current segment + // to the selection rectangle and continue. + // if selection right > segment_line_end then selection spans end of current segment... if (selection_right >= segment_line_end) { // extend selection slightly beyond end of line @@ -1852,7 +1855,7 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round, } else if (hit_past_end_of_line && segmentp->getEnd() >= line_iter->mDocIndexEnd - 1) { - // segment wraps to next line, so just set doc pos to start of next line + // segment wraps to next line, so just set doc pos to start of next line (represented by mDocIndexEnd) pos = llmin(getLength(), line_iter->mDocIndexEnd); break; } -- cgit v1.2.3