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

Method onLayout

snap_drawing/src/snap_drawing/cpp/Layers/FlexboxLayer.cpp:311–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309}
310
311void FlexboxLayer::onLayout() {
312 Layer::onLayout();
313
314 auto node = mustGetFlexboxNode(this);
315 if (YGNodeGetOwner(node->yogaNode) == nullptr) {
316 // we are the root node, calculate the layout starting from us
317 node->calculateLayout(getFrame().size(), isRightToLeft());
318 }
319
320 auto childrenSize = getChildrenSize();
321 for (size_t i = 0; i < childrenSize; i++) {
322 auto child = getChild(i);
323 auto childNode = mustGetFlexboxNode(child.get());
324
325 child->setFrame(childNode->getFrame());
326 }
327}
328
329FlexboxAttributes FlexboxLayer::updateLayoutAttributes() {
330 return updateLayoutAttributesForLayer(this);

Callers

nothing calls this directly

Calls 8

mustGetFlexboxNodeFunction · 0.85
YGNodeGetOwnerFunction · 0.85
getChildFunction · 0.85
getFrameMethod · 0.80
getMethod · 0.65
calculateLayoutMethod · 0.45
sizeMethod · 0.45
setFrameMethod · 0.45

Tested by

no test coverage detected