diff options
Diffstat (limited to 'indra/newview/llthumbnailctrl.cpp')
-rw-r--r-- | indra/newview/llthumbnailctrl.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/indra/newview/llthumbnailctrl.cpp b/indra/newview/llthumbnailctrl.cpp index b558c249cb..8291b0b061 100644 --- a/indra/newview/llthumbnailctrl.cpp +++ b/indra/newview/llthumbnailctrl.cpp @@ -1,25 +1,25 @@ -/** +/** * @file llthumbnailctrl.cpp * @brief LLThumbnailCtrl base class * * $LicenseInfo:firstyear=2023&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2023, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -51,7 +51,7 @@ LLThumbnailCtrl::Params::Params() {} LLThumbnailCtrl::LLThumbnailCtrl(const LLThumbnailCtrl::Params& p) -: LLUICtrl(p) +: LLUICtrl(p) , mBorderColor(p.border_color()) , mBorderVisible(p.border_visible()) , mFallbackImagep(p.fallback_image) @@ -61,14 +61,14 @@ LLThumbnailCtrl::LLThumbnailCtrl(const LLThumbnailCtrl::Params& p) , mInitImmediately(true) { mLoadingPlaceholderString = LLTrans::getString("texture_loading"); - + LLRect border_rect = getLocalRect(); LLViewBorder::Params vbparams(p.border); vbparams.name("border"); vbparams.rect(border_rect); mBorder = LLUICtrlFactory::create<LLViewBorder> (vbparams); addChild(mBorder); - + if (p.image_name.isProvided()) { setValue(p.image_name()); @@ -77,7 +77,7 @@ LLThumbnailCtrl::LLThumbnailCtrl(const LLThumbnailCtrl::Params& p) LLThumbnailCtrl::~LLThumbnailCtrl() { - mTexturep = nullptr; + mTexturep = nullptr; mImagep = nullptr; mFallbackImagep = nullptr; } @@ -90,11 +90,11 @@ void LLThumbnailCtrl::draw() initImage(); } LLRect draw_rect = getLocalRect(); - + if (mBorderVisible) { mBorder->setKeyboardFocusHighlight(hasFocus()); - + gl_rect_2d( draw_rect, mBorderColor.get(), FALSE ); draw_rect.stretch( -1 ); } @@ -108,9 +108,9 @@ void LLThumbnailCtrl::draw() const LLColor4 color(.098f, .098f, .098f); gl_rect_2d( draw_rect, color, TRUE); } - + gl_draw_scaled_image( draw_rect.mLeft, draw_rect.mBottom, draw_rect.getWidth(), draw_rect.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha); - + mTexturep->setKnownDrawSize(draw_rect.getWidth(), draw_rect.getHeight()); } else if( mImagep.notNull() ) @@ -195,15 +195,15 @@ void LLThumbnailCtrl::clearTexture() // value might be a string or a UUID void LLThumbnailCtrl::setValue(const LLSD& value) { - LLSD tvalue(value); - if (value.isString() && LLUUID::validate(value.asString())) - { - //RN: support UUIDs masquerading as strings - tvalue = LLSD(LLUUID(value.asString())); - } - - LLUICtrl::setValue(tvalue); - + LLSD tvalue(value); + if (value.isString() && LLUUID::validate(value.asString())) + { + //RN: support UUIDs masquerading as strings + tvalue = LLSD(LLUUID(value.asString())); + } + + LLUICtrl::setValue(tvalue); + unloadImage(); if (mInitImmediately) |