summaryrefslogtreecommitdiff
path: root/indra/llui/lliconctrl.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-05-06 18:21:04 -0700
committerMerov Linden <merov@lindenlab.com>2014-05-06 18:21:04 -0700
commit8dae4bc222d1b0744254442ab0b26538285341de (patch)
tree88da67f01f0dc32457b4a5085d5e699ea55715a4 /indra/llui/lliconctrl.cpp
parentf6bb6a0f935323434a3f3d0d94e94c8d8238effe (diff)
parentd0ef02c23a7a37c8c9bfe3a86bae88bb811fc9fe (diff)
Pull merge from lindenlab/viewer-release. Fixed some conflicts and compile errors
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) ;
- }
- }
-}