diff options
author | Ruslan Teliuk <ruslantproductengine@lindenlab.com> | 2015-12-21 18:21:05 +0200 |
---|---|---|
committer | Ruslan Teliuk <ruslantproductengine@lindenlab.com> | 2015-12-21 18:21:05 +0200 |
commit | 7ce37f9910016f7225621df9e70dd2fd7c41725d (patch) | |
tree | db09b96def05e74d4b93de43d442618a70a52ef1 /indra/llui/lliconctrl.cpp | |
parent | cbdf791fb1634c3c42c1e24da4b99dfdc3251f26 (diff) | |
parent | 5099d01b74cfdd4ba192844b9fb7c5d19c454a54 (diff) |
Merged lindenlab/viewer-lion into default
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); } } |