summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-10-03 23:08:52 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-10-04 19:35:08 +0300
commitd76e8dd61120fd82dbfbed786d803d16af7d6d4d (patch)
treeaba70e7c9be532946c1dc28b0bc246ae20fa1d62 /indra
parente093a98f86ad46374f5067adb616a2aead73eff5 (diff)
viewer-private#300 Fix inconsistency with multiple textures
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/lltexturectrl.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 35057a910a..f125d81430 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -1029,8 +1029,11 @@ void LLFloaterTexturePicker::onBtnCancel(void* userdata)
void LLFloaterTexturePicker::onBtnSelect(void* userdata)
{
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
- if (self->mOnFloaterCommitCallback)
+ if (self->mViewModel->isDirty() && self->mOnFloaterCommitCallback)
{
+ // If nothing changed, don't commit.
+ // ex: can overwrite multiple original textures with a single one.
+ // or resubmit something thus overriding some other source of change
self->commitCallback(LLTextureCtrl::TEXTURE_SELECT);
}
self->closeFloater();
@@ -1067,8 +1070,18 @@ void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem
{
mNoCopyTextureSelected = true;
}
+ bool was_dirty = mViewModel->isDirty();
setImageIDFromItem(itemp, false);
- mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here?
+ if (user_action)
+ {
+ mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here?
+ setTentative( false );
+ }
+ else if (!was_dirty)
+ {
+ // setImageIDFromItem could have dropped the flag
+ mViewModel->resetDirty();
+ }
if(!mPreviewSettingChanged)
{