summaryrefslogtreecommitdiff
path: root/indra/llui/lltextbase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r--indra/llui/lltextbase.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 1f120a1483..cb0907a771 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1137,6 +1137,11 @@ void LLTextBase::reflow(S32 start_index)
// grow line height as necessary based on reported height of this segment
line_height = llmax(line_height, segment_height);
remaining_pixels -= segment_width;
+ if (remaining_pixels < 0)
+ {
+ // getNumChars() and getDimensions() should return consistent results
+ remaining_pixels = 0;
+ }
seg_offset += character_count;
@@ -2464,6 +2469,12 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
{
LLWString text = mEditor.getWText();
+ LLUIImagePtr image = mStyle->getImage();
+ if( image.notNull())
+ {
+ num_pixels -= image->getWidth();
+ }
+
// search for newline and if found, truncate there
S32 last_char = mStart + segment_offset;
for (; last_char != mEnd; ++last_char)