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

Method increaseHorizontalSpacing

core/ui/LayoutHelper.cpp:831–843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

829}
830
831void LayoutHelper::increaseHorizontalSpacing(std::vector<Node*>& nodes, float theSpacing)
832{
833 if (nodes.size() < 2)
834 return;
835
836 std::sort(nodes.begin(), nodes.end(),
837 [](Node* const left, Node* const right) -> bool { return getNodeLeft(left) < getNodeLeft(right); });
838
839 for (size_t idx = 1; idx < nodes.size(); ++idx)
840 {
841 nodes[idx]->setPositionX(nodes[idx]->getPositionX() + theSpacing * idx);
842 }
843}
844
845void LayoutHelper::increaseVerticalSpacing(std::vector<Node*>& nodes, float theSpacing)
846{

Callers

nothing calls this directly

Calls 7

getNodeLeftFunction · 0.85
sortFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
setPositionXMethod · 0.45
getPositionXMethod · 0.45

Tested by

no test coverage detected