diff options
-rw-r--r-- | gtk/gtkconstraintlayout.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/gtk/gtkconstraintlayout.c b/gtk/gtkconstraintlayout.c index 14b8fa6e80..b37f51c8a0 100644 --- a/gtk/gtkconstraintlayout.c +++ b/gtk/gtkconstraintlayout.c @@ -719,24 +719,18 @@ gtk_constraint_layout_measure (GtkLayoutManager *manager, &min_size, &nat_size, NULL, NULL); - if (child_info->width_constraint[0] != NULL) - { - gtk_constraint_solver_remove_constraint (solver, child_info->width_constraint[0]); - gtk_constraint_solver_remove_constraint (solver, child_info->width_constraint[1]); - } - - if (child_info->height_constraint[0] != NULL) - { - gtk_constraint_solver_remove_constraint (solver, child_info->height_constraint[0]); - gtk_constraint_solver_remove_constraint (solver, child_info->height_constraint[1]); - } - switch (orientation) { case GTK_ORIENTATION_HORIZONTAL: width_var = get_child_attribute (child_info, solver, child, GTK_CONSTRAINT_ATTRIBUTE_WIDTH); + if (child_info->width_constraint[0] != NULL) + { + gtk_constraint_solver_remove_constraint (solver, child_info->width_constraint[0]); + gtk_constraint_solver_remove_constraint (solver, child_info->width_constraint[1]); + } + child_info->width_constraint[0] = gtk_constraint_solver_add_constraint (solver, width_var, @@ -755,6 +749,12 @@ gtk_constraint_layout_measure (GtkLayoutManager *manager, height_var = get_child_attribute (child_info, solver, child, GTK_CONSTRAINT_ATTRIBUTE_HEIGHT); + if (child_info->height_constraint[0] != NULL) + { + gtk_constraint_solver_remove_constraint (solver, child_info->height_constraint[0]); + gtk_constraint_solver_remove_constraint (solver, child_info->height_constraint[1]); + } + child_info->height_constraint[0] = gtk_constraint_solver_add_constraint (solver, height_var, |