update yoga

This commit is contained in:
2019-03-17 16:11:44 +01:00
parent 94e44a9338
commit 680ad60c2b
6 changed files with 179 additions and 55 deletions

View File

@@ -124,7 +124,8 @@ kEventResult Node::on_event(Event* e)
if (!skip_children)
{
for (auto it = m_children.rbegin(); it != m_children.rend(); ++it)
auto children_copy = m_children; // make a copy for safety
for (auto it = children_copy.rbegin(); it != children_copy.rend(); ++it)
{
if ((*it)->on_event(e) == kEventResult::Consumed)
{
@@ -534,6 +535,7 @@ Node&& Node::operator=(Node&& o)
Node::Node()
{
y_node = YGNodeNew();
YGNodeSetContext(y_node, this);
y_placeholder = nullptr;
}