summaryrefslogtreecommitdiff
path: root/indra/llui/lliconctrl.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2014-02-24 18:45:59 -0800
committerRichard Linden <none@none>2014-02-24 18:45:59 -0800
commit80b4a4a1f54dccb814b5486423bf6492b3ae58a7 (patch)
treef17c7a9b433e443b2f30251dd15b1bf50d4f803c /indra/llui/lliconctrl.cpp
parentde8fea13627cc5978b8a6135802a52864a11c39a (diff)
parentef591d280eb3c5bae7da20540ad4cbb30858d0aa (diff)
merge with release
Diffstat (limited to 'indra/llui/lliconctrl.cpp')
-rwxr-xr-xindra/llui/lliconctrl.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp
index 30b79b4d20..58b66f60ca 100755
--- a/indra/llui/lliconctrl.cpp
+++ b/indra/llui/lliconctrl.cpp
@@ -42,7 +42,9 @@ LLIconCtrl::Params::Params()
: image("image_name"),
color("color"),
use_draw_context_alpha("use_draw_context_alpha", true),
- scale_image("scale_image")
+ scale_image("scale_image"),
+ min_width("min_width", 0),
+ min_height("min_height", 0)
{}
LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p)
@@ -51,8 +53,8 @@ LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p)
mImagep(p.image),
mUseDrawContextAlpha(p.use_draw_context_alpha),
mPriority(0),
- mDrawWidth(0),
- mDrawHeight(0)
+ mMinWidth(p.min_width),
+ mMinHeight(p.min_height)
{
if (mImagep.notNull())
{
@@ -97,7 +99,13 @@ void LLIconCtrl::setValue(const LLSD& value )
mImagep = LLUI::getUIImage(tvalue.asString(), mPriority);
}
- setIconImageDrawSize();
+ if(mImagep.notNull()
+ && mImagep->getImage().notNull()
+ && mMinWidth
+ && mMinHeight)
+ {
+ mImagep->getImage()->setKnownDrawSize(llmax(mMinWidth, mImagep->getWidth()), llmax(mMinHeight, mImagep->getHeight()));
+ }
}
std::string LLIconCtrl::getImageName() const
@@ -108,14 +116,4 @@ std::string LLIconCtrl::getImageName() const
return std::string();
}
-void LLIconCtrl::setIconImageDrawSize()
-{
- if(mImagep.notNull() && mDrawWidth && mDrawHeight)
- {
- if(mImagep->getImage().notNull())
- {
- mImagep->getImage()->setKnownDrawSize(mDrawWidth, mDrawHeight) ;
- }
- }
-}