mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
constraint layout: freeze/thaw on mass ops
In measure and allocate we are potentially changing quite a few constraints. Don't optimize at every step.
This commit is contained in:
parent
511e2b435e
commit
f62fc4e2f2
@ -710,6 +710,7 @@ gtk_constraint_layout_measure (GtkLayoutManager *manager,
|
||||
return;
|
||||
|
||||
size_constraints = g_ptr_array_new ();
|
||||
gtk_constraint_solver_freeze (solver);
|
||||
|
||||
/* We measure each child in the layout and impose restrictions on the
|
||||
* minimum and natural size, so we can solve the size of the overall
|
||||
@ -763,6 +764,8 @@ gtk_constraint_layout_measure (GtkLayoutManager *manager,
|
||||
g_ptr_array_add (size_constraints, constraint);
|
||||
}
|
||||
|
||||
gtk_constraint_solver_thaw (solver);
|
||||
|
||||
switch (orientation)
|
||||
{
|
||||
case GTK_ORIENTATION_HORIZONTAL:
|
||||
@ -879,6 +882,7 @@ gtk_constraint_layout_allocate (GtkLayoutManager *manager,
|
||||
gtk_constraint_variable_get_value (layout_height)));
|
||||
|
||||
size_constraints = g_ptr_array_new ();
|
||||
gtk_constraint_solver_freeze (solver);
|
||||
|
||||
/* We reset the constraints on the size of each child, so we are sure the
|
||||
* layout is up to date
|
||||
@ -931,6 +935,8 @@ gtk_constraint_layout_allocate (GtkLayoutManager *manager,
|
||||
g_ptr_array_add (size_constraints, constraint);
|
||||
}
|
||||
|
||||
gtk_constraint_solver_thaw (solver);
|
||||
|
||||
for (child = _gtk_widget_get_first_child (widget);
|
||||
child != NULL;
|
||||
child = _gtk_widget_get_next_sibling (child))
|
||||
|
Loading…
Reference in New Issue
Block a user