summaryrefslogtreecommitdiff
path: root/indra/llui/lliconctrl.cpp
diff options
context:
space:
mode:
authorpavelkproductengine <pavelkproductengine@lindenlab.com>2016-03-21 18:36:50 +0200
committerpavelkproductengine <pavelkproductengine@lindenlab.com>2016-03-21 18:36:50 +0200
commit5bbf263c293286395730d969e0b9beec9d830f48 (patch)
tree22b81dea68f728ec122de561cb8d77fe4fb14d94 /indra/llui/lliconctrl.cpp
parent824deea265614b649e074d4702e8f4bf071cef68 (diff)
parent4aae7b51616c0963af4668442bdb5bfaba8c5044 (diff)
Merge
Diffstat (limited to 'indra/llui/lliconctrl.cpp')
-rwxr-xr-xindra/llui/lliconctrl.cpp14
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);
}
}