| 152 | } |
| 153 | |
| 154 | void 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 | |
| 174 | void Node::setDirty(bool isDirty) { |
| 175 | if (static_cast<int>(isDirty) == isDirty_) { |
no test coverage detected