diff options
author | Richard Linden <none@none> | 2011-08-11 10:09:28 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2011-08-11 10:09:28 -0700 |
commit | 9a9e78740ada6a64847d1e915ae8e92258e8f10a (patch) | |
tree | 43935b338c5a87ca32f9240389470a96271fa1f5 /indra/llui | |
parent | 8b09dfb8907c364f09ee82d00926219ae52b5ee9 (diff) | |
parent | 7cc7d143837f2b75f750c139e33fdf5afa8a8866 (diff) |
Automated merge with file:///e:\code\viewer-experience
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; |