diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-03-22 16:19:10 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-03-22 16:19:10 -0400 |
commit | 0879c48d832a69050e6fc6ac67b0d5f95b52e054 (patch) | |
tree | c872ae80e13d12c3a282fd2af2c5005b0edb5e95 /indra/llui/lliconctrl.cpp | |
parent | cbbe82b8dc08260aa4102214a7c99aeab7915371 (diff) | |
parent | 2afde26d93cc8773f5e84d187844f909347fc1bf (diff) |
merge
Diffstat (limited to 'indra/llui/lliconctrl.cpp')
-rwxr-xr-x | indra/llui/lliconctrl.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp index 58b66f60ca..f841901801 100755 --- a/indra/llui/lliconctrl.cpp +++ b/indra/llui/lliconctrl.cpp @@ -54,7 +54,9 @@ LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p) mUseDrawContextAlpha(p.use_draw_context_alpha), mPriority(0), mMinWidth(p.min_width), - mMinHeight(p.min_height) + mMinHeight(p.min_height), + mMaxWidth(0), + mMaxHeight(0) { if (mImagep.notNull()) { @@ -104,7 +106,15 @@ void LLIconCtrl::setValue(const LLSD& value ) && mMinWidth && mMinHeight) { - mImagep->getImage()->setKnownDrawSize(llmax(mMinWidth, mImagep->getWidth()), llmax(mMinHeight, mImagep->getHeight())); + S32 desired_draw_width = llmax(mMinWidth, mImagep->getWidth()); + S32 desired_draw_height = llmax(mMinHeight, mImagep->getHeight()); + if (mMaxWidth && mMaxHeight) + { + desired_draw_width = llmin(desired_draw_width, mMaxWidth); + desired_draw_height = llmin(desired_draw_height, mMaxHeight); + } + + mImagep->getImage()->setKnownDrawSize(desired_draw_width, desired_draw_height); } } |