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

Method insertChildAt

valdi/src/valdi/runtime/Context/ViewNode.cpp:1489–1536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1487 if (_scrollState == nullptr || !_scrollState->isInScrollMode()) {
1488 return 0;
1489 }
1490 return _scrollState->getRtlOffsetX();
1491}
1492
1493float ViewNode::getViewOffsetX() const {
1494 return _viewFrame.x - _calculatedFrame.x;
1495}
1496
1497float ViewNode::getViewOffsetY() const {
1498 return _viewFrame.y - _calculatedFrame.y;
1499}
1500
1501const StringBox& ViewNode::getViewClassName() const {
1502 const auto& boundAttributes = _attributesApplier.getBoundAttributes();
1503 if (boundAttributes == nullptr) {
1504 return StringBox::emptyString();
1505 }
1506
1507 return boundAttributes->getClassName();
1508}
1509
1510void ViewNode::setViewFactory(ViewTransactionScope& viewTransactionScope, const Ref<ViewFactory>& viewFactory) {
1511 if (_viewFactory != viewFactory) {
1512 removeView(viewTransactionScope);
1513 _viewFactory = viewFactory;
1514 auto previousManagesChildFrames = managesChildFrames();
1515 _flags[kManagesChildFrames] = viewFactory != nullptr && viewFactory->managesChildFrames();
1516 if (previousManagesChildFrames != managesChildFrames()) {
1517 auto previousIsLazyLayout = isLazyLayout();
1518 updateIsLazyLayout(viewTransactionScope);
1519 if (previousIsLazyLayout == isLazyLayout()) {
1520 reinsertChildrenInYogaContainer(viewTransactionScope);
1521 }
1522 }
1523
1524 if (viewFactory != nullptr) {
1525 setIsLayout(viewFactory->getViewClassName() == AttributesManager::getLayoutPlaceholderClassName());
1526 auto boundAttributes = viewFactory->getBoundAttributes();
1527 _attributesApplier.setBoundAttributes(boundAttributes);
1528 _flags[kScrollAttributesBound] =
1529 (boundAttributes != nullptr && boundAttributes->isBackingClassScrollable());
1530
1531 if (_flags[kScrollAttributesBound]) {
1532 getYogaStyle(getYogaNodeForInsertingChildren()).setOverflow(facebook::yoga::Overflow::Scroll);
1533 }
1534 updateYogaMeasureFunc();
1535 } else {
1536 setIsLayout(true);
1537 _attributesApplier.setBoundAttributes(nullptr);
1538 }
1539 }

Callers 2

TESTFunction · 0.80
visitMethod · 0.80

Calls 15

weakRefFunction · 0.85
resolveYogaNodeFunction · 0.85
getViewNodeTreeFunction · 0.85
toXMLFunction · 0.85
YGNodeInsertChildFunction · 0.85
getChildCountFunction · 0.85
setHasParentMethod · 0.80
setMeasureFuncMethod · 0.80
needUpdateCSSMethod · 0.80
setCSSNeedsUpdateMethod · 0.80
cssNeedsUpdateMethod · 0.80
getZIndexMethod · 0.80

Tested by 1

TESTFunction · 0.64