summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-07-29 11:05:09 -0400
committerOz Linden <oz@lindenlab.com>2011-07-29 11:05:09 -0400
commit8554772a3ce7572aacc2f2d27c66438970103570 (patch)
treed7b799585326a7434eb19895a0015a54773c0925 /indra
parent97030fe7a61bf32e9eceacff8c03479814e4ed76 (diff)
parentaad5943ab05cd5689b2898174c085fe9d5f69345 (diff)
merge changes for storm-1234
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/lltextbase.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 349dbc3405..919364be63 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2024,8 +2024,17 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round,
}
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
- pos = llclamp(line_iter->mDocIndexEnd - 1, 0, getLength());
+ if (getLineNumFromDocIndex(line_iter->mDocIndexEnd - 1) == line_iter->mLineNum)
+ {
+ // if segment wraps to the next line we should step one char back
+ // to compensate for the space char between words
+ // which is removed due to wrapping
+ pos = llclamp(line_iter->mDocIndexEnd - 1, 0, getLength());
+ }
+ else
+ {
+ pos = llclamp(line_iter->mDocIndexEnd, 0, getLength());
+ }
break;
}
start_x += text_width;