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

Method setNodeNormalizedPositionX

core/ui/LayoutHelper.cpp:1267–1274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1265}
1266
1267void LayoutHelper::VisibleRect::setNodeNormalizedPositionX(ax::Node* pNode, float ratio)
1268{
1269 AX_ASSERT(pNode);
1270 ax::Rect visibleRect = LayoutHelper::LayoutHelper::VisibleRect::getScreenVisibleRect();
1271 ax::Point ptWorld(visibleRect.size.width * ratio + visibleRect.origin.x, 0);
1272 auto ptLocal = pNode->getParent()->convertToNodeSpace(ptWorld);
1273 pNode->setPositionX(ptLocal.x);
1274}
1275
1276void LayoutHelper::VisibleRect::setNodeNormalizedPositionY(ax::Node* pNode, float ratio)
1277{

Callers

nothing calls this directly

Calls 3

convertToNodeSpaceMethod · 0.80
getParentMethod · 0.45
setPositionXMethod · 0.45

Tested by

no test coverage detected