summaryrefslogtreecommitdiff
path: root/indra/llui/lltextbase.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-05-04 09:36:39 -0400
committerOz Linden <oz@lindenlab.com>2011-05-04 09:36:39 -0400
commit3b79c9c81dc1ba4cb92f1ac54bd74a57e6d5aa05 (patch)
treecf27e69ff2bea8c621d1073172636146b8c73a57 /indra/llui/lltextbase.cpp
parentc3df5f5d675abd107e1f0b4e3fb262226978ddb5 (diff)
parentb9bb792c478d703c6442351ecb563c0a67f77111 (diff)
merge changes for viewer-development before mesh 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 82269282ef..fd7bb699f8 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2022,11 +2022,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;