summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-09-25 20:24:57 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-09-25 20:24:57 +0300
commit226081b27511ad45fbeaa16b9226265dc446976b (patch)
tree46c660d2853aab05eb8c1ecea8ef6776a4493dec
parent627a6a2d0fb9b041d42d98a7b6301793ca8a7184 (diff)
SL-20334 Unable to use non-square textures from inventory
-rw-r--r--indra/newview/lltexturectrl.cpp4
-rw-r--r--indra/newview/lltexturectrl.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 0c3730d084..2e137a8e12 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -176,6 +176,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker(
mSelectedItemPinned( FALSE ),
mCanApply(true),
mCanPreview(true),
+ mLimitsSet(false),
mMaxDim(S32_MAX),
mMinDim(0),
mPreviewSettingChanged(false),
@@ -282,7 +283,7 @@ bool LLFloaterTexturePicker::updateImageStats()
S32 height = mTexturep->getFullHeight();
if (width > 0 && height > 0)
{
- if (width != height
+ if ((mLimitsSet && (width != height))
|| width < mMinDim
|| width > mMaxDim
|| height < mMinDim
@@ -1200,6 +1201,7 @@ void LLFloaterTexturePicker::setCanApply(bool can_preview, bool can_apply, bool
void LLFloaterTexturePicker::setMinDimentionsLimits(S32 min_dim)
{
mMinDim = min_dim;
+ mLimitsSet = true;
std::string formatted_dims = llformat("%dx%d", mMinDim, mMinDim);
mResolutionWarning->setTextArg("[MINTEXDIM]", formatted_dims);
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h
index 7239b97552..e2bfe286d3 100644
--- a/indra/newview/lltexturectrl.h
+++ b/indra/newview/lltexturectrl.h
@@ -403,6 +403,7 @@ private:
bool mCanApply;
bool mCanPreview;
bool mPreviewSettingChanged;
+ bool mLimitsSet;
S32 mMaxDim;
S32 mMinDim;