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

Function resolveYogaValue

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

Source from the content-addressed store, hash-verified

2153 directionAgnosticVisual += getDirectionAgnosticTransform();
2154 // If we have a scrollable parent, try to move the content offset if needed
2155 auto parent = getParent();
2156 auto parentFrame = parent->getCalculatedFrame();
2157 auto& parentScrollState = parent->_scrollState;
2158 if (parentScrollState != nullptr) {
2159 // What's the current occlusion in this scroll view
2160 auto directionAgnosticContentOffset = parentScrollState->getDirectionAgnosticContentOffset();
2161 directionAgnosticVisual -= directionAgnosticContentOffset;
2162 // Compute the displacement needed to fit the frame into the scroll content viewport
2163 auto directionAgnosticDisplacement = Point(0, 0);
2164 if (directionAgnosticVisual.x < 0) {
2165 directionAgnosticDisplacement.x = directionAgnosticVisual.x;
2166 } else if (directionAgnosticVisual.x + size.width > parentFrame.width) {
2167 directionAgnosticDisplacement.x = directionAgnosticVisual.x + size.width - parentFrame.width;
2168 }
2169 if (directionAgnosticVisual.y < 0) {
2170 directionAgnosticDisplacement.y = directionAgnosticVisual.y;

Callers 1

doCalculateLayoutOnNodeFunction · 0.85

Calls 5

minFunction · 0.85
valueMethod · 0.65
isPointsMethod · 0.45
unwrapMethod · 0.45
isPercentMethod · 0.45

Tested by

no test coverage detected