| 262 | |
| 263 | void RuntimeListener::setLayoutSpecsToContextIfNeeded(Valdi::Runtime& runtime, const Valdi::SharedContext& context) { |
| 264 | if (!layoutTreeAutomatically) { |
| 265 | return; |
| 266 | } |
| 267 | |
| 268 | auto tree = runtime.getViewNodeTreeManager().getViewNodeTreeForContextId(context->getContextId()); |
| 269 | if (tree != nullptr && tree->getRootView() != nullptr) { |
| 270 | auto& rootView = getDummyView(tree->getRootView()).getImpl(); |
| 271 | |
| 272 | if (rootView.isLayoutInvalidated()) { |
| 273 | rootView.setLayoutInvalidated(false); |
| 274 | tree->setLayoutSpecs(rootView.getFrame().size(), Valdi::LayoutDirectionLTR); |
| 275 | } |
| 276 | } |
| 277 | } |
no test coverage detected