From 226081b27511ad45fbeaa16b9226265dc446976b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 25 Sep 2023 20:24:57 +0300 Subject: SL-20334 Unable to use non-square textures from inventory --- indra/newview/lltexturectrl.cpp | 4 +++- indra/newview/lltexturectrl.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'indra') 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; -- cgit v1.2.3