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
@ -1075,10 +1075,24 @@ gtk_snapshot_append_node_internal (GtkSnapshot *snapshot,
|
||||
current_state = gtk_snapshot_get_current_state (snapshot);
|
||||
|
||||
if (current_state)
|
||||
{
|
||||
if (gsk_render_node_get_node_type (node) == GSK_CONTAINER_NODE)
|
||||
{
|
||||
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
|
||||
{
|
||||
g_critical ("Tried appending a node to an already finished snapshot.");
|
||||
|
Loading…
Reference in New Issue
Block a user