diff options
| author | Oz Linden <oz@lindenlab.com> | 2016-03-16 13:08:06 -0400 |
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2016-03-16 13:08:06 -0400 |
| commit | 31f3db02919870a8e92c9452de477c1478b273e9 (patch) | |
| tree | 1acf6944bf8dbe0b67bb64caee9188ad5e36d913 /indra/llui/lliconctrl.cpp | |
| parent | 0b996159cef3a4022c6a3d4691bd2e2db37b6e92 (diff) | |
| parent | 9197a8652e49178c63ea208c6c4acf1ca3433659 (diff) | |
merge changes for DRTVWR-417
Diffstat (limited to 'indra/llui/lliconctrl.cpp')
| -rw-r--r-- | 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 100644 --- 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); } } |
