improve scrollbar detection and scroll behavior

This commit is contained in:
2019-01-31 15:09:49 +01:00
parent fbe07e2fc6
commit 6159e71eed
5 changed files with 44 additions and 10 deletions

View File

@@ -241,6 +241,7 @@ void Node::add_child(Node* n)
n->m_manager = m_manager;
YGNodeInsertChild(y_node, n->y_node, YGNodeGetChildCount(y_node));
n->added(this);
on_child_added(n);
}
void Node::add_child(Node* n, int index)
@@ -250,6 +251,7 @@ void Node::add_child(Node* n, int index)
n->m_manager = m_manager;
YGNodeInsertChild(y_node, n->y_node, index);
n->added(this);
on_child_added(n);
}
void Node::add_child(std::shared_ptr<Node> n)
@@ -259,6 +261,7 @@ void Node::add_child(std::shared_ptr<Node> n)
n->m_manager = m_manager;
YGNodeInsertChild(y_node, n->y_node, YGNodeGetChildCount(y_node));
n->added(this);
on_child_added(n.get());
}
void Node::add_child(std::shared_ptr<Node> n, int index)
@@ -268,6 +271,7 @@ void Node::add_child(std::shared_ptr<Node> n, int index)
n->m_manager = m_manager;
YGNodeInsertChild(y_node, n->y_node, index);
n->added(this);
on_child_added(n.get());
}
void Node::remove_child(Node* n)
@@ -277,6 +281,7 @@ void Node::remove_child(Node* n)
{
n->removed(this);
YGNodeRemoveChild(y_node, n->y_node);
on_child_removed(n);
m_children.erase(i);
}
}
@@ -287,6 +292,7 @@ void Node::remove_all_children()
{
n->removed(this);
YGNodeRemoveChild(y_node, n->y_node);
on_child_removed(n.get());
}
m_children.clear();
}