[gtk/matthiasc/for-master] center layout: Fix handling of expanding center child
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master] center layout: Fix handling of expanding center child
- Date: Fri, 1 Jan 2021 16:04:04 +0000 (UTC)
commit 2d3885a44ab3c9c815d15b4f9571c2161599f7fb
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jan 1 11:02:57 2021 -0500
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
gtk/gtkcenterlayout.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/gtkcenterlayout.c b/gtk/gtkcenterlayout.c
index f9fa988ca7..b2dee1db0d 100644
--- a/gtk/gtkcenterlayout.c
+++ b/gtk/gtkcenterlayout.c
@@ -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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]