void YogaLayoutableShadowNode::layoutChildren(LayoutContext layoutContext) { for (const auto &childYogaNode : yogaNode_.getChildren()) { auto childNode = static_cast<YogaLayoutableShadowNode *>(childYogaNode->getContext()); LayoutMetrics childLayoutMetrics = layoutMetricsFromYogaNode(childNode->yogaNode_); childLayoutMetrics.pointScaleFactor = layoutContext.pointScaleFactor; childNode->setLayoutMetrics(childLayoutMetrics); } }
void YogaLayoutableShadowNode::layoutChildren(LayoutContext layoutContext) { for (auto child : getLayoutableChildNodes()) { auto yogaLayoutableChild = std::dynamic_pointer_cast<const YogaLayoutableShadowNode>(child); if (!yogaLayoutableChild) { continue; } auto nonConstYogaLayoutableChild = std::const_pointer_cast<YogaLayoutableShadowNode>(yogaLayoutableChild); LayoutMetrics childLayoutMetrics = layoutMetricsFromYogaNode(nonConstYogaLayoutableChild->yogaNode_); nonConstYogaLayoutableChild->setLayoutMetrics(childLayoutMetrics); } }
void YogaLayoutableShadowNode::layoutChildren(LayoutContext layoutContext) { ensureUnsealed(); for (auto child : getChildren()) { auto yogaLayoutableChild = std::dynamic_pointer_cast<const YogaLayoutableShadowNode>(child); if (!yogaLayoutableChild) { continue; } auto nonConstYogaLayoutableChild = std::const_pointer_cast<YogaLayoutableShadowNode>(yogaLayoutableChild); LayoutMetrics childLayoutMetrics = layoutMetricsFromYogaNode(*nonConstYogaLayoutableChild->yogaNode_); bool isAffected = nonConstYogaLayoutableChild->setLayoutMetrics(childLayoutMetrics); if (isAffected) { layoutContext.affectedShadowNodes->insert(child); } } }