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

Method setPositionNormalized

core/ui/UIWidget.cpp:1112–1131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1110}
1111
1112void 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
1133void Widget::setPositionPercent(const Vec2& percent)
1134{

Callers 3

createControlsMethod · 0.45
setMediaControllerMethod · 0.45

Calls 3

getContentSizeMethod · 0.45
setZeroMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected