diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-10-31 21:24:41 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-10-31 21:24:41 +0200 |
commit | 4cb5439e425dbfd354a27cbfbfe071904d068d5d (patch) | |
tree | c5adf254c7de39502a968865d438d31f099971e7 /indra | |
parent | b1f529082ba0d785bafe1aa49298eb2f9eca1d3f (diff) |
SL-18446 Don't cause excessive udpates
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llmaterialeditor.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 70ba77e18b..20fee6686c 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -2221,17 +2221,22 @@ void LLMaterialEditor::applyToSelection() std::string url = gAgent.getRegionCapability("ModifyMaterialParams"); if (!url.empty()) { - mOverrideInProgress = true; - LLObjectSelectionHandle selected_objects = LLSelectMgr::getInstance()->getSelection(); - // TODO figure out how to get the right asset id in cases where we don't have a good one - LLRenderMaterialOverrideFunctor override_func(this, url); - if (!selected_objects->applyToTEs(&override_func)) + // Don't send data if there is nothing to send. + // Some UI elements will cause multiple commits, + // like spin ctrls on click and on down + if (mUnsavedChanges != 0) { - mOverrideInProgress = false; - } + mOverrideInProgress = true; + LLObjectSelectionHandle selected_objects = LLSelectMgr::getInstance()->getSelection(); + LLRenderMaterialOverrideFunctor override_func(this, url); + if (!selected_objects->applyToTEs(&override_func)) + { + mOverrideInProgress = false; + } - // we posted all changes - mUnsavedChanges = 0; + // we posted all changes + mUnsavedChanges = 0; + } } else { |