diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-01-20 13:54:34 -0800 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-01-20 13:54:34 -0800 |
commit | a65188d85f75e848d224bd335a00ed8aa51f945e (patch) | |
tree | f43b390cba45d047fc0fa31659f6969f62b925d1 /indra/newview/lltexturectrl.cpp | |
parent | 1a8008ea150d1eb9a8f4036988ef971fb1901cb3 (diff) | |
parent | 5ca943cd0279d35ffdf584fa0de3b795645f276c (diff) |
Merge from viewer2. Minor conflict resolved.
Diffstat (limited to 'indra/newview/lltexturectrl.cpp')
-rw-r--r-- | indra/newview/lltexturectrl.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index e7cf4a1a0e..a65e990ef8 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -878,6 +878,7 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p) { setAllowNoTexture(p.allow_no_texture); setCanApplyImmediately(p.can_apply_immediately); + mCommitOnSelection = !p.no_commit_on_selection; LLTextBox::Params params(p.caption_text); params.name(p.label); @@ -1122,7 +1123,11 @@ void LLTextureCtrl::onFloaterCommit(ETexturePickOp op) } else { - onCommit(); + // If the "no_commit_on_selection" parameter is set + // we commit only when user presses OK in the picker + // (i.e. op == TEXTURE_SELECT) or changes texture via DnD. + if (mCommitOnSelection || op == TEXTURE_SELECT) + onCommit(); } } } @@ -1192,8 +1197,12 @@ void LLTextureCtrl::draw() } else if (!mImageAssetID.isNull()) { - mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID, MIPMAP_YES); - mTexturep->setBoostLevel(LLViewerTexture::BOOST_PREVIEW); + LLPointer<LLViewerFetchedTexture> texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID, MIPMAP_YES,LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + + texture->setBoostLevel(LLViewerTexture::BOOST_PREVIEW); + texture->forceToSaveRawImage(0) ; + + mTexturep = texture; } else if (!mFallbackImageName.empty()) { |