Skip to content
Snippets Groups Projects
Commit a8fffc7d authored by andreykproductengine's avatar andreykproductengine
Browse files

MAINT-731 Fixed Images Do Not Show at Proper Proportions

parent 13cddfdf
No related branches found
No related tags found
No related merge requests found
...@@ -52,6 +52,8 @@ ...@@ -52,6 +52,8 @@
#include "llviewerwindow.h" #include "llviewerwindow.h"
#include "lllineeditor.h" #include "lllineeditor.h"
#include <boost/lexical_cast.hpp>
const S32 CLIENT_RECT_VPAD = 4; const S32 CLIENT_RECT_VPAD = 4;
const F32 SECONDS_TO_SHOW_FILE_SAVED_MSG = 8.f; const F32 SECONDS_TO_SHOW_FILE_SAVED_MSG = 8.f;
...@@ -579,7 +581,11 @@ void LLPreviewTexture::adjustAspectRatio() ...@@ -579,7 +581,11 @@ void LLPreviewTexture::adjustAspectRatio()
std::vector<std::string>::const_iterator found = std::find(mRatiosList.begin(), mRatiosList.end(), ratio.str()); std::vector<std::string>::const_iterator found = std::find(mRatiosList.begin(), mRatiosList.end(), ratio.str());
if (found == mRatiosList.end()) 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 else
{ {
...@@ -587,6 +593,15 @@ void LLPreviewTexture::adjustAspectRatio() ...@@ -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; mUpdateDimensions = TRUE;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment