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

Function getResolvedLayoutProperty

third-party/yoga/src/yoga/YGNodeLayout.cpp:19–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17
18template <auto LayoutMember>
19float getResolvedLayoutProperty(const YGNodeConstRef nodeRef, const Edge edge) {
20 const auto node = resolveRef(nodeRef);
21 yoga::assertFatalWithNode(
22 node,
23 edge <= Edge::End,
24 "Cannot get layout properties of multi-edge shorthands");
25
26 if (edge == Edge::Start) {
27 if (node->getLayout().direction() == Direction::RTL) {
28 return (node->getLayout().*LayoutMember)(PhysicalEdge::Right);
29 } else {
30 return (node->getLayout().*LayoutMember)(PhysicalEdge::Left);
31 }
32 }
33
34 if (edge == Edge::End) {
35 if (node->getLayout().direction() == Direction::RTL) {
36 return (node->getLayout().*LayoutMember)(PhysicalEdge::Left);
37 } else {
38 return (node->getLayout().*LayoutMember)(PhysicalEdge::Right);
39 }
40 }
41
42 return (node->getLayout().*LayoutMember)(static_cast<PhysicalEdge>(edge));
43}
44
45} // namespace
46

Callers

nothing calls this directly

Calls 3

assertFatalWithNodeFunction · 0.85
directionMethod · 0.80
resolveRefFunction · 0.50

Tested by

no test coverage detected