FIX: filament override is not correct

Multiple filament slots does not change the actual filament settings
Jira: 3797

Change-Id: Ib377b4c79aae731caa97b408e84a87a33b3bb155
(cherry picked from commit 7d704d8f0bae14f16087c77c1bd90946632330a6)
(cherry picked from commit 43e8956a1ffc9e2afbc82fdb77565f0543ac8a68)
This commit is contained in:
zhimin.zeng 2023-09-13 09:24:36 +08:00 committed by Lane.Wei
parent 4c2754f4ee
commit f964842d8f

View file

@ -534,22 +534,25 @@ public:
}
return false;
}
size_t i = 0;
size_t cnt = std::min(this->size(), rhs_vec->size());
bool modified = false;
for (; i < cnt; ++ i)
if (! rhs_vec->is_nil(i) && this->values[i] != rhs_vec->values[i]) {
this->values[i] = rhs_vec->values[i];
modified = true;
}
for (; i < rhs_vec->size(); ++ i)
if (! rhs_vec->is_nil(i)) {
if (cnt < 1)
return false;
if (this->values.empty())
this->values.resize(i + 1);
this->values.resize(rhs_vec->size());
else
this->values.resize(i + 1, this->values.front());
this->values.resize(rhs_vec->size(), this->values.front());
bool modified = false;
auto default_value = this->values[0];
for (size_t i = 0; i < rhs_vec->size(); ++i) {
if (!rhs_vec->is_nil(i)) {
this->values[i] = rhs_vec->values[i];
modified = true;
} else {
this->values[i] = default_value;
}
}
return modified;
}