diff options
author | simon <none@none> | 2014-05-07 10:56:41 -0700 |
---|---|---|
committer | simon <none@none> | 2014-05-07 10:56:41 -0700 |
commit | 250db74bf9325acdc1169f6c13d297e7fe44b753 (patch) | |
tree | c6926efeefeb10ec3a36b296aa1ac7bd8521e0e3 /indra/llui/lliconctrl.cpp | |
parent | 676bad148a72c235ec79742e3f490ca66b4f40d0 (diff) | |
parent | d0ef02c23a7a37c8c9bfe3a86bae88bb811fc9fe (diff) |
Pull and merge viewer-release as version 3.7.8
Diffstat (limited to 'indra/llui/lliconctrl.cpp')
-rwxr-xr-x | indra/llui/lliconctrl.cpp | 26 |
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) ; - } - } -} |