From ac3e604bb6fbc27db4af418ed7b9af0b0c32bb14 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 25 Apr 2020 12:47:17 -0400 Subject: [PATCH 1/3] reftests: Use transform syntax This is supposed to fix the background-image-multiple reftest, but it doesn't. There's an actual bug here. --- .../reftests/background-image-multiple.ref.ui | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/testsuite/reftests/background-image-multiple.ref.ui b/testsuite/reftests/background-image-multiple.ref.ui index 159868dd72..599d6b62c6 100644 --- a/testsuite/reftests/background-image-multiple.ref.ui +++ b/testsuite/reftests/background-image-multiple.ref.ui @@ -41,10 +41,7 @@ 144 70 - + translate(0,0) @@ -55,10 +52,7 @@ 120 46 - + translate(12,12) @@ -75,10 +69,7 @@ 144 70 - + translate(0,0) @@ -89,10 +80,7 @@ 120 46 - + translate(12,12) From b64f889cd9e794355e3b2a3dff122689d946a286 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 25 Apr 2020 13:18:34 -0400 Subject: [PATCH 2/3] fixed: Fix an oversight in size requisition We need to take orientation into account when applying child transforms. This is what broke the background-image-multiple reftest. --- gtk/gtkfixedlayout.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/gtk/gtkfixedlayout.c b/gtk/gtkfixedlayout.c index e5c90f15ab..b024469dec 100644 --- a/gtk/gtkfixedlayout.c +++ b/gtk/gtkfixedlayout.c @@ -251,12 +251,25 @@ gtk_fixed_layout_measure (GtkLayoutManager *layout_manager, &child_min_opp, &child_nat_opp, NULL, NULL); - gsk_transform_transform_bounds (child_info->transform, - &GRAPHENE_RECT_INIT (0.f, 0.f, child_min, child_min_opp), - &min_rect); - gsk_transform_transform_bounds (child_info->transform, - &GRAPHENE_RECT_INIT (0.f, 0.f, child_nat, child_nat_opp), - &nat_rect); + min_rect.origin.x = min_rect.origin.y = 0; + nat_rect.origin.x = nat_rect.origin.y = 0; + if (orientation == GTK_ORIENTATION_HORIZONTAL) + { + min_rect.size.width = child_min; + min_rect.size.height = child_min_opp; + nat_rect.size.width = child_nat; + nat_rect.size.height = child_nat_opp; + } + else + { + min_rect.size.width = child_min_opp; + min_rect.size.height = child_min; + nat_rect.size.width = child_nat_opp; + nat_rect.size.height = child_nat; + } + + gsk_transform_transform_bounds (child_info->transform, &min_rect, &min_rect); + gsk_transform_transform_bounds (child_info->transform, &nat_rect, &nat_rect); if (orientation == GTK_ORIENTATION_HORIZONTAL) { From 99d7130da3a8e9578c8c12582b1c260df01a2070 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 25 Apr 2020 13:26:14 -0400 Subject: [PATCH 3/3] reftests: Remove background-image-multiple from xfails It no longer fails. --- testsuite/reftests/meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build index ef4817483c..0affb5d3c2 100644 --- a/testsuite/reftests/meson.build +++ b/testsuite/reftests/meson.build @@ -422,7 +422,6 @@ testdata = [ # These need to be fixed but the issue hasn't been tracked down. xfails = [ - 'background-image-multiple.ui', 'background-origin.ui', # see above #'sizegroups-evolution-identity-page.ui',