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

Method setNodeBottom

core/ui/LayoutHelper.cpp:1077–1091  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1075 pNode->setPositionX(ptLocal.x);
1076}
1077void LayoutHelper::VisibleRect::setNodeBottom(Node* pNode, float bottom)
1078{
1079 AX_ASSERT(pNode);
1080 Vec2 scrSize = Director::getInstance()->getRenderView()->getDesignResolutionSize();
1081 ax::Point delta = ax::Vec2(scrSize.width, 0) - LayoutHelper::VisibleRect::rightBottom();
1082 Vec2 size = pNode->getContentSize() * getScale2D(pNode);
1083 ax::Point achorPoint = Vec2::ZERO;
1084 if (!pNode->isIgnoreAnchorPointForPosition())
1085 {
1086 achorPoint = pNode->getAnchorPoint();
1087 }
1088 ax::Point ptWorld(0, adjust_coord(size.height, achorPoint.y, bottom) - delta.y);
1089 auto ptLocal = pNode->getParent()->convertToNodeSpace(ptWorld);
1090 pNode->setPositionY(ptLocal.y);
1091}
1092
1093void LayoutHelper::VisibleRect::setNodeLT(Node* pNode, const ax::Point& p)
1094{

Callers

nothing calls this directly

Calls 9

getInstanceFunction · 0.85
getScale2DFunction · 0.85
getAnchorPointMethod · 0.80
convertToNodeSpaceMethod · 0.80
Vec2Function · 0.50
getContentSizeMethod · 0.45
getParentMethod · 0.45
setPositionYMethod · 0.45

Tested by

no test coverage detected