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

Method setPositionPercentX

core/ui/UILayoutComponent.cpp:227–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225 return _positionPercentX;
226}
227void LayoutComponent::setPositionPercentX(float percentMargin)
228{
229 _positionPercentX = percentMargin;
230
231 if (_usingPositionPercentX || _horizontalEdge == HorizontalEdge::Center)
232 {
233 Node* parent = this->getOwnerParent();
234 if (parent != nullptr)
235 {
236 _owner->setPositionX(parent->getContentSize().width * _positionPercentX);
237 this->refreshHorizontalMargin();
238 }
239 }
240}
241
242bool LayoutComponent::isPositionPercentYEnabled() const
243{

Calls 4

getOwnerParentMethod · 0.95
setPositionXMethod · 0.45
getContentSizeMethod · 0.45

Tested by

no test coverage detected