summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Linden <none@none>2010-03-23 12:47:11 -0700
committerRichard Linden <none@none>2010-03-23 12:47:11 -0700
commite3e50bf7ed48c6ee0a199d27fce7ba888793429d (patch)
treeb1ba5dc3791c85d955efd6b383d5c83b51e548e6
parent3d977127559280bf37a89714893a13eb288e634f (diff)
added some comments for fix to EXT-5549
-rw-r--r--indra/llui/lltextbase.cpp7
1 files changed, 5 insertions, 2 deletions
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;
}