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

Method setNodeNormalizedPositionY

core/ui/LayoutHelper.cpp:1276–1284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1274}
1275
1276void LayoutHelper::VisibleRect::setNodeNormalizedPositionY(ax::Node* pNode, float ratio)
1277{
1278 AX_ASSERT(pNode);
1279 ax::Rect visibleRect = LayoutHelper::LayoutHelper::VisibleRect::getScreenVisibleRect();
1280
1281 ax::Point ptWorld(0, visibleRect.size.height * ratio + visibleRect.origin.y);
1282 auto ptLocal = pNode->getParent()->convertToNodeSpace(ptWorld);
1283 pNode->setPositionY(ptLocal.y);
1284}
1285void LayoutHelper::VisibleRect::setNodeNormalizedPosition(Node* pNode, const ax::Point& ratio)
1286{
1287 AX_ASSERT(pNode);

Callers

nothing calls this directly

Calls 3

convertToNodeSpaceMethod · 0.80
getParentMethod · 0.45
setPositionYMethod · 0.45

Tested by

no test coverage detected