save brushes settings

This commit is contained in:
2019-02-03 14:36:48 +01:00
parent d8728344c4
commit c2d526dec9
7 changed files with 207 additions and 68 deletions

View File

@@ -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)