diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index 966b00e151..d7aee2ccc7 100644 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -93,6 +93,20 @@ LLVisualParamHint::LLVisualParamHint( { LLVisualParamHint::sInstances.insert( this ); mBackgroundp = LLUI::getUIImage("avatar_thumb_bkgrnd.png"); + if (mBackgroundp) + { + LLViewerFetchedTexture* tex = dynamic_cast(mBackgroundp->getImage().get()); + if (tex) + { + tex->setKnownDrawSize(width, height); + } + + mBackgroundLoadedConnection = mBackgroundp->addLoadedCallback([this]() + { + mNeedsUpdate = true; + mDelayFrames = 0; + }); + } llassert(width != 0); llassert(height != 0); @@ -104,6 +118,7 @@ LLVisualParamHint::LLVisualParamHint( LLVisualParamHint::~LLVisualParamHint() { LLVisualParamHint::sInstances.erase( this ); + mBackgroundLoadedConnection.disconnect(); } //virtual diff --git a/indra/newview/lltoolmorph.h b/indra/newview/lltoolmorph.h index fb62ba9bba..9f4b5f6fe9 100644 --- a/indra/newview/lltoolmorph.h +++ b/indra/newview/lltoolmorph.h @@ -95,6 +95,7 @@ protected: LLJoint* mCamTargetJoint; // joint to target with preview camera LLUIImagePtr mBackgroundp; + boost::signals2::scoped_connection mBackgroundLoadedConnection; typedef std::set< LLVisualParamHint* > instance_list_t; static instance_list_t sInstances;