MCPcopy Create free account
hub / github.com/Snapchat/Valdi / replaceValue

Method replaceValue

valdi/src/valdi/runtime/Attributes/ViewNodeAttribute.cpp:185–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183 }
184}
185
186void ViewNodeAttribute::replaceValue(const Value& value) {
187 // TODO(simon): In replaceValue() we are overidding values
188 // in every existing attribute. This is so that attributes
189 // updated from platform side can be reflected here. We should
190 // remove this concept at some point and instead have contentOffset
191 // and others not exposed as an attribute.
192
193 if (_hasSingleAttribute) {
194 auto& attributeValue = getSingleAttributeValue();
195 attributeValue.value = value;
196 attributeValue.preprocessedValue = PreprocessedValue(value);
197 } else if (_hasAttributeCollection) {
198 for (auto& attributeValue : getAttributeValueCollection().values) {
199 attributeValue.value = value;
200 attributeValue.preprocessedValue = PreprocessedValue(value);
201 }
202 }
203
204 _appliedValueDirty = false;
205 _hasAppliedValue = true;
206}
207
208Value ViewNodeAttribute::getResolvedValue() const {

Callers 1

Calls 1

PreprocessedValueClass · 0.85

Tested by

no test coverage detected