diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-05-30 16:28:07 +0300 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-05-30 16:28:07 +0300 |
commit | a8fffc7d172d3a786904e6d8e7e7c2943e6d54fc (patch) | |
tree | 9f7668fa718d56e37fa0f5dbebba1c6c4e017fe5 /indra/newview | |
parent | 13cddfdfdd8c42367af8a197e1f2deefc986495b (diff) |
MAINT-731 Fixed Images Do Not Show at Proper Proportions
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpreviewtexture.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 645a77e42a..54eeebda28 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -52,6 +52,8 @@ #include "llviewerwindow.h" #include "lllineeditor.h" +#include <boost/lexical_cast.hpp> + const S32 CLIENT_RECT_VPAD = 4; const F32 SECONDS_TO_SHOW_FILE_SAVED_MSG = 8.f; @@ -579,7 +581,11 @@ void LLPreviewTexture::adjustAspectRatio() std::vector<std::string>::const_iterator found = std::find(mRatiosList.begin(), mRatiosList.end(), ratio.str()); if (found == mRatiosList.end()) { - combo->setCurrentByIndex(0); + // No existing ratio found, create an element that will show image at original ratio + std::string ratio = boost::lexical_cast<std::string>(num)+":" + boost::lexical_cast<std::string>(denom); + mRatiosList.push_back(ratio); + combo->add(ratio); + combo->setCurrentByIndex(mRatiosList.size()- 1); } else { @@ -587,6 +593,15 @@ void LLPreviewTexture::adjustAspectRatio() } } } + else + { + // Aspect ratio was set to unconstrained or was clamped + LLComboBox* combo = getChild<LLComboBox>("combo_aspect_ratio"); + if (combo) + { + combo->setCurrentByIndex(0); //unconstrained + } + } mUpdateDimensions = TRUE; } |