MCPcopy Create free account
hub / github.com/axmolengine/axmol / doLayout

Method doLayout

core/ui/UIHelper.cpp:149–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147 _activeLayout = bActive;
148}
149void Helper::doLayout(ax::Node* rootNode)
150{
151 if (!_activeLayout)
152 {
153 return;
154 }
155
156 for (auto&& node : rootNode->getChildren())
157 {
158 auto com = node->getComponent(__LAYOUT_COMPONENT_NAME);
159 Node* parent = node->getParent();
160 if (nullptr != com && nullptr != parent)
161 {
162 LayoutComponent* layoutComponent = (LayoutComponent*)com;
163
164 layoutComponent->refreshLayout();
165 }
166 }
167}
168
169Rect Helper::restrictCapInsetRect(const ax::Rect& capInsets, const Vec2& textureSize)
170{

Callers 1

Calls 3

refreshLayoutMethod · 0.80
getComponentMethod · 0.45
getParentMethod · 0.45

Tested by

no test coverage detected