summaryrefslogtreecommitdiff
path: root/indra/llui/lltextbase.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2011-05-04 10:06:34 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2011-05-04 10:06:34 -0400
commit0be3b1fdd9821929fc537e1c812f26268979dbf0 (patch)
tree2848e2c95a4006e6c9e5fcad11fe9b1ab2488db3 /indra/llui/lltextbase.cpp
parent8decd5a4e6c94e27381186e581cf199ba3ede437 (diff)
parenta23ad02cf568b680a409cf40f69cfb1b1591082c (diff)
merge
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r--indra/llui/lltextbase.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 2060e5f9cf..1c19a33c4e 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2021,11 +2021,10 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round,
pos = segment_line_start + offset;
break;
}
- else if (hit_past_end_of_line && segmentp->getEnd() > line_iter->mDocIndexEnd - 1)
+ else if (hit_past_end_of_line && segmentp->getEnd() >= line_iter->mDocIndexEnd)
{
// segment wraps to next line, so just set doc pos to the end of the 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);
+ pos = llclamp(line_iter->mDocIndexEnd - 1, 0, getLength());
break;
}
start_x += text_width;