mirror of
https://github.com/geode-sdk/geode.git
synced 2025-02-17 00:30:26 -05:00
add child order update option to CCNode::updateLayout
This commit is contained in:
parent
676b96a34f
commit
8890901af5
2 changed files with 5 additions and 2 deletions
|
@ -940,7 +940,7 @@ public:
|
|||
* set, nothing happens
|
||||
* @note Geode addition
|
||||
*/
|
||||
GEODE_DLL void updateLayout();
|
||||
GEODE_DLL void updateLayout(bool updateChildOrder = true);
|
||||
/**
|
||||
* Set the layout options for this node. Layout options can be used to
|
||||
* control how this node is positioned in its parent's Layout, for example
|
||||
|
|
|
@ -147,7 +147,10 @@ LayoutOptions* CCNode::getLayoutOptions() {
|
|||
return GeodeNodeMetadata::set(this)->m_layoutOptions.get();
|
||||
}
|
||||
|
||||
void CCNode::updateLayout() {
|
||||
void CCNode::updateLayout(bool updateChildOrder) {
|
||||
if (updateChildOrder) {
|
||||
this->sortAllChildren();
|
||||
}
|
||||
if (auto layout = GeodeNodeMetadata::set(this)->m_layout.get()) {
|
||||
layout->apply(this);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue