MCPcopy Create free account
hub / github.com/AshampooSystems/boden / applyLayout

Method applyLayout

framework/ui/modules/yoga/src/ViewData.cpp:70–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 }
69
70 void ViewData::applyLayout(YGNodeRef node, Point offset)
71 {
72 if (auto ctxt = YGNodeGetContext(node)) {
73 auto viewData = static_cast<ViewData *>(ctxt);
74
75 Rect r{YGNodeLayoutGetLeft(node), YGNodeLayoutGetTop(node), YGNodeLayoutGetWidth(node),
76 YGNodeLayoutGetHeight(node)};
77
78 if (std::isnan(r.x)) {
79 r.x = 0;
80 }
81 if (std::isnan(r.y)) {
82 r.y = 0;
83 }
84 if (std::isnan(r.width)) {
85 r.width = 0;
86 }
87 if (std::isnan(r.height)) {
88 r.height = 0;
89 }
90
91 r.x += offset.x;
92 r.y += offset.y;
93
94 viewData->view->geometry = r;
95 }
96 }
97
98 void ViewData::yogaVisit(YGNodeRef node, const std::function<void(YGNodeRef, Point)> &function, Point initialOffset)
99 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected