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

Method setPositionPercentY

core/ui/UILayoutComponent.cpp:259–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257 return _positionPercentY;
258}
259void LayoutComponent::setPositionPercentY(float percentMargin)
260{
261 _positionPercentY = percentMargin;
262
263 if (_usingPositionPercentY || _verticalEdge == VerticalEdge::Center)
264 {
265 Node* parent = this->getOwnerParent();
266 if (parent != nullptr)
267 {
268 _owner->setPositionY(parent->getContentSize().height * _positionPercentY);
269 this->refreshVerticalMargin();
270 }
271 }
272}
273
274LayoutComponent::HorizontalEdge LayoutComponent::getHorizontalEdge() const
275{

Calls 4

getOwnerParentMethod · 0.95
refreshVerticalMarginMethod · 0.95
setPositionYMethod · 0.45
getContentSizeMethod · 0.45

Tested by

no test coverage detected