diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 1e6048160c..1d6a4e8d83 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -61,6 +61,8 @@ #include "fscommon.h" #include "llviewermenu.h" +#include + const S32 CLIENT_RECT_VPAD = 4; const F32 SECONDS_TO_SHOW_FILE_SAVED_MSG = 8.f; @@ -1037,7 +1039,11 @@ void LLPreviewTexture::adjustAspectRatio() std::vector::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(num)+":" + boost::lexical_cast(denom); + mRatiosList.push_back(ratio); + combo->add(ratio); + combo->setCurrentByIndex(mRatiosList.size()- 1); } else { @@ -1045,6 +1051,15 @@ void LLPreviewTexture::adjustAspectRatio() } } } + else + { + // Aspect ratio was set to unconstrained or was clamped + LLComboBox* combo = getChild("combo_aspect_ratio"); + if (combo) + { + combo->setCurrentByIndex(0); //unconstrained + } + } mUpdateDimensions = TRUE; }