| 1245 | } |
| 1246 | |
| 1247 | void LayoutHelper::VisibleRect::setNodeNormalizedTop(Node* pNode, const float ratioTop) |
| 1248 | { // right top |
| 1249 | AX_ASSERT(pNode); |
| 1250 | Vec2 scrSize = Director::getInstance()->getRenderView()->getDesignResolutionSize(); |
| 1251 | ax::Point delta = ax::Vec2(scrSize.width, scrSize.height) - LayoutHelper::VisibleRect::rightTop(); |
| 1252 | |
| 1253 | Vec2 vscrSize = LayoutHelper::VisibleRect::size(); |
| 1254 | float top = vscrSize.width * ratioTop; |
| 1255 | |
| 1256 | Vec2 size = pNode->getContentSize() * getScale2D(pNode); |
| 1257 | ax::Point achorPoint = Vec2::ZERO; |
| 1258 | if (!pNode->isIgnoreAnchorPointForPosition()) |
| 1259 | { |
| 1260 | achorPoint = pNode->getAnchorPoint(); |
| 1261 | } |
| 1262 | ax::Point ptWorld(0, adjust_coord_neg(scrSize.height, size.height, achorPoint.y, top) - delta.y); |
| 1263 | auto ptLocal = pNode->getParent()->convertToNodeSpace(ptWorld); |
| 1264 | pNode->setPositionY(ptWorld.y); |
| 1265 | } |
| 1266 | |
| 1267 | void LayoutHelper::VisibleRect::setNodeNormalizedPositionX(ax::Node* pNode, float ratio) |
| 1268 | { |
nothing calls this directly
no test coverage detected