[gtk/wip/baedert/transforms5: 268/272] widget: Get CSS values later in size_allocate



commit 308b25b3b2309865cfd30e4c490b839b0dd0131d
Author: Timm Bäder <mail baedert org>
Date:   Sat Aug 18 16:18:27 2018 +0200

    widget: Get CSS values later in size_allocate
    
    Since we save the baseline without the css values applied now, we don't
    need them as early and can especially push the retrieval down after the
    "only the position changed" fast-path.

 gtk/gtkwidget.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index d33564e9ed..ee4cc73881 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4196,11 +4196,6 @@ gtk_widget_size_allocate_transformed (GtkWidget               *widget,
   priv->allocated_height = height;
   priv->allocated_size_baseline = baseline;
 
-  style = gtk_css_node_get_style (priv->cssnode);
-  get_box_margin (style, &margin);
-  get_box_border (style, &border);
-  get_box_padding (style, &padding);
-
   if (gtk_widget_get_request_mode (widget) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH)
     {
       /* Go ahead and request the height for allocated width, note that the internals
@@ -4311,6 +4306,11 @@ gtk_widget_size_allocate_transformed (GtkWidget               *widget,
       goto check_clip;
     }
 
+  style = gtk_css_node_get_style (priv->cssnode);
+  get_box_margin (style, &margin);
+  get_box_border (style, &border);
+  get_box_padding (style, &padding);
+
   /* Since gtk_widget_measure does it for us, we can be sure here that
    * the given alloaction is large enough for the css margin/bordder/padding */
   adjusted_width  -= margin.left + border.left + padding.left +


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]