| 1045 | pNode->setPositionX(ptLocal.x); |
| 1046 | } |
| 1047 | void LayoutHelper::VisibleRect::setNodeTop(Node* pNode, float top) |
| 1048 | { |
| 1049 | AX_ASSERT(pNode); |
| 1050 | Vec2 scrSize = Director::getInstance()->getRenderView()->getDesignResolutionSize(); |
| 1051 | ax::Point delta = ax::Vec2(0, scrSize.height) - LayoutHelper::VisibleRect::leftTop(); |
| 1052 | Vec2 size = pNode->getContentSize() * getScale2D(pNode); |
| 1053 | ax::Point achorPoint = Vec2::ZERO; |
| 1054 | if (!pNode->isIgnoreAnchorPointForPosition()) |
| 1055 | { |
| 1056 | achorPoint = pNode->getAnchorPoint(); |
| 1057 | } |
| 1058 | ax::Point ptWorld(0, adjust_coord_neg(scrSize.height, size.height, achorPoint.y, top) - delta.y); |
| 1059 | auto ptLocal = pNode->getParent()->convertToNodeSpace(ptWorld); |
| 1060 | pNode->setPositionY(ptLocal.y); |
| 1061 | } |
| 1062 | void LayoutHelper::VisibleRect::setNodeRight(Node* pNode, float right) |
| 1063 | { |
| 1064 | AX_ASSERT(pNode); |
nothing calls this directly
no test coverage detected