diff options
author | Merov Linden <merov@lindenlab.com> | 2011-08-02 14:41:28 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2011-08-02 14:41:28 -0700 |
commit | 8d081d34fc56fd1b742045dd120b6acbda0d027e (patch) | |
tree | bad359d12509e1543db1d24970f18f8ba88d01a1 /indra/llui | |
parent | 75d2382dc3fd1beb190eba12188883db98278f89 (diff) | |
parent | 9eb555bbe60e0f388593c489d6c473e4adcbd956 (diff) |
Sync with lindenlab/viewer-development
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lltextbase.cpp | 13 |
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; |