fix a really bad bug using parent instead if this to set children's parent
This commit is contained in:
@@ -205,8 +205,7 @@ void Node::load_internal(const tinyxml2::XMLElement* x_node)
|
||||
auto id = const_hash(ids);
|
||||
auto& ref = (*m_manager)[id];
|
||||
m_children.push_back(ref.clone());
|
||||
m_children.back().parent = parent;
|
||||
m_children.back().m_manager = m_manager;
|
||||
m_children.back().parent = this;
|
||||
YGNodeInsertChild(y_node, m_children.back().y_node, YGNodeGetChildCount(y_node));
|
||||
}
|
||||
else
|
||||
@@ -228,6 +227,7 @@ Node Node::clone()
|
||||
YGNodeCopyStyle(n.y_node, y_node);
|
||||
if (m_widget)
|
||||
n.m_widget = m_widget->clone();
|
||||
n.m_manager = m_manager;
|
||||
for (auto& c : m_children)
|
||||
{
|
||||
n.m_children.push_back(std::move(c.clone()));
|
||||
|
||||
Reference in New Issue
Block a user