[gtk/matthiasc/for-master] fixed: Fix an oversight in size requisition
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master] fixed: Fix an oversight in size requisition
- Date: Sat, 25 Apr 2020 17:20:08 +0000 (UTC)
commit b64f889cd9e794355e3b2a3dff122689d946a286
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Apr 25 13:18:34 2020 -0400
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)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]