mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 14:31:10 +00:00
snapshot: merge container nodes
A container node inside another container node doesn't make a lot of sense, we can instead just use the parent container node and add the child container node's children to it directly.
This commit is contained in:
parent
2815054820
commit
622a150bb4
@ -1076,8 +1076,22 @@ gtk_snapshot_append_node_internal (GtkSnapshot *snapshot,
|
|||||||
|
|
||||||
if (current_state)
|
if (current_state)
|
||||||
{
|
{
|
||||||
g_ptr_array_add (snapshot->nodes, gsk_render_node_ref (node));
|
if (gsk_render_node_get_node_type (node) == GSK_CONTAINER_NODE)
|
||||||
current_state->n_nodes ++;
|
{
|
||||||
|
guint i, p;
|
||||||
|
|
||||||
|
for (i = 0, p = gsk_container_node_get_n_children (node); i < p; i ++)
|
||||||
|
g_ptr_array_add (snapshot->nodes,
|
||||||
|
gsk_render_node_ref (gsk_container_node_get_child (node, i)));
|
||||||
|
|
||||||
|
current_state->n_nodes += p;
|
||||||
|
/* Don't unref @node... */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_ptr_array_add (snapshot->nodes, gsk_render_node_ref (node));
|
||||||
|
current_state->n_nodes ++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user