save brushes settings
This commit is contained in:
@@ -266,7 +266,7 @@ void Node::add_child(std::shared_ptr<Node> n)
|
||||
|
||||
void Node::add_child(std::shared_ptr<Node> n, int index)
|
||||
{
|
||||
m_children.push_back(n);
|
||||
m_children.insert(m_children.begin() + index, n);
|
||||
n->parent = this;
|
||||
n->m_manager = m_manager;
|
||||
YGNodeInsertChild(y_node, n->y_node, index);
|
||||
@@ -301,6 +301,11 @@ void Node::move_child(Node* n, int index)
|
||||
{
|
||||
YGNodeRemoveChild(y_node, n->y_node);
|
||||
YGNodeInsertChild(y_node, n->y_node, index);
|
||||
auto it = std::find_if(m_children.begin(), m_children.end(),
|
||||
[n](const std::shared_ptr<Node>& o) { return o.get() == n; });
|
||||
auto tmp = *it; // copy the ptr before removing it
|
||||
m_children.erase(it);
|
||||
m_children.insert(m_children.begin() + index, tmp);
|
||||
}
|
||||
|
||||
void Node::move_child_offset(Node* n, int offset)
|
||||
|
||||
Reference in New Issue
Block a user