| 1110 | } |
| 1111 | |
| 1112 | void Widget::setPositionNormalized(const Vec2& position) |
| 1113 | { |
| 1114 | if (!_usingLayoutComponent && _running) |
| 1115 | { |
| 1116 | Widget* widgetParent = getWidgetParent(); |
| 1117 | if (widgetParent) |
| 1118 | { |
| 1119 | Vec2 pSize = widgetParent->getContentSize(); |
| 1120 | if (pSize.width <= 0.0f || pSize.height <= 0.0f) |
| 1121 | { |
| 1122 | _positionPercent.setZero(); |
| 1123 | } |
| 1124 | else |
| 1125 | { |
| 1126 | _positionPercent.set(position.x, position.y); |
| 1127 | } |
| 1128 | } |
| 1129 | } |
| 1130 | ProtectedNode::setPositionNormalized(position); |
| 1131 | } |
| 1132 | |
| 1133 | void Widget::setPositionPercent(const Vec2& percent) |
| 1134 | { |
no test coverage detected