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

Method increaseVerticalSpacing

core/ui/LayoutHelper.cpp:845–857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

843}
844
845void LayoutHelper::increaseVerticalSpacing(std::vector<Node*>& nodes, float theSpacing)
846{
847 if (nodes.size() < 2)
848 return;
849
850 std::sort(nodes.begin(), nodes.end(),
851 [](Node* const left, Node* const right) -> bool { return getNodeTop(left) < getNodeTop(right); });
852
853 for (size_t idx = 1; idx < nodes.size(); ++idx)
854 {
855 nodes[idx]->setPositionY(nodes[idx]->getPositionY() - theSpacing * idx);
856 }
857}
858
859void LayoutHelper::decreaseHorizontalSpacing(std::vector<Node*>& nodes, float theSpacing)
860{

Callers

nothing calls this directly

Calls 7

getNodeTopFunction · 0.85
sortFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
setPositionYMethod · 0.45
getPositionYMethod · 0.45

Tested by

no test coverage detected