summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorrichard <none@none>2009-12-17 09:54:44 -0800
committerrichard <none@none>2009-12-17 09:54:44 -0800
commitf452c01915be011814d92dcc1a398f450b6ce9c2 (patch)
tree320efb5b15aae503d5a529dd4f32d0372317d3c8 /indra/llui
parent1a4047c590443fac682b53ceb18a631b350f03b7 (diff)
EXT-3087 - Crash when avatar icon truncated in interactive notifications
reviewed by Mani
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lltextbase.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 1f120a1483..6c983fd92e 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1138,6 +1138,8 @@ void LLTextBase::reflow(S32 start_index)
line_height = llmax(line_height, segment_height);
remaining_pixels -= segment_width;
+ // getNumChars() and getDimensions() should return consistent results
+ llassert_always(remaining_pixels >= 0);
seg_offset += character_count;
S32 last_segment_char_on_line = segment->getStart() + seg_offset;
@@ -2464,6 +2466,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)