diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-12-09 14:53:12 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-12-09 14:53:12 -0500 |
commit | f7215a5d7cb4f6431bbd63c42617b0a3dd207ac3 (patch) | |
tree | 0d84524f0269a6b982db3376658df19a9eebf7c1 /indra/llui/lltextbase.cpp | |
parent | 96d5f52624d68768592893ee0b27a0589b0f6222 (diff) | |
parent | 2c0cea901712ffad012356278d72e3c3d844e5bc (diff) |
automated merge viewer2.0->avp
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r-- | indra/llui/lltextbase.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index e0750968ae..2a9515171a 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2207,6 +2207,12 @@ LLNormalTextSegment::LLNormalTextSegment( const LLStyleSP& style, S32 start, S32 mEditor(editor) { mFontHeight = llceil(mStyle->getFont()->getLineHeight()); + + LLUIImagePtr image = mStyle->getImage(); + if (image.notNull()) + { + mImageLoadedConnection = image->addLoadedCallback(boost::bind(&LLTextBase::needsReflow, &mEditor)); + } } LLNormalTextSegment::LLNormalTextSegment( const LLColor4& color, S32 start, S32 end, LLTextBase& editor, BOOL is_visible) @@ -2219,6 +2225,12 @@ LLNormalTextSegment::LLNormalTextSegment( const LLColor4& color, S32 start, S32 mFontHeight = llceil(mStyle->getFont()->getLineHeight()); } +LLNormalTextSegment::~LLNormalTextSegment() +{ + mImageLoadedConnection.disconnect(); +} + + F32 LLNormalTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) { if( end - start > 0 ) @@ -2232,7 +2244,7 @@ F32 LLNormalTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selec // Center the image vertically S32 image_bottom = draw_rect.getCenterY() - (style_image_height/2); image->draw(draw_rect.mLeft, image_bottom, - style_image_width, style_image_height); + style_image_width, style_image_height, color); } return drawClippedSegment( getStart() + start, getStart() + end, selection_start, selection_end, draw_rect); |