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

Method setConfig

third-party/yoga/src/yoga/node/Node.cpp:154–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154void Node::setConfig(yoga::Config* config) {
155 yoga::assertFatal(
156 config != nullptr, "Attempting to set a null config on a Node");
157 yoga::assertFatalWithConfig(
158 config,
159 config->useWebDefaults() == config_->useWebDefaults(),
160 "UseWebDefaults may not be changed after constructing a Node");
161
162 if (yoga::configUpdateInvalidatesLayout(*config_, *config)) {
163 markDirtyAndPropagate();
164 layout_.configVersion = 0;
165 } else {
166 // If the config is functionally the same, then align the configVersion so
167 // that we can reuse the layout cache
168 layout_.configVersion = config->getVersion();
169 }
170
171 config_ = config;
172}
173
174void Node::setDirty(bool isDirty) {
175 if (static_cast<int>(isDirty) == isDirty_) {

Callers 1

YGNodeSetConfigFunction · 0.80

Calls 5

assertFatalFunction · 0.85
assertFatalWithConfigFunction · 0.85
useWebDefaultsMethod · 0.80
getVersionMethod · 0.65

Tested by

no test coverage detected