center layout: Fix handling of expanding center child

We were not taking spacing into account when adjusting
the size of an expanding center child, causing it to slip
under the end child at times.

Fixes: #3506
This commit is contained in:
Matthias Clasen 2021-01-01 11:02:57 -05:00
parent 572649740e
commit 2d3885a44a

View File

@ -177,7 +177,7 @@ gtk_center_layout_distribute (GtkCenterLayout *self,
center_pos = size - center_size - end_size - spacing;
else if (center_expand)
{
center_size = size - 2 * MAX (start_size, end_size);
center_size = size - 2 * (MAX (start_size, end_size) + spacing);
center_pos = (size / 2) - (center_size / 2) + spacing;
}