[gtk+] label: Don't set out parameters twice



commit e75894da13e378e26df076f17cbd7e4ba6284e27
Author: Timm Bäder <mail baedert org>
Date:   Tue May 3 16:04:58 2016 -0400

    label: Don't set out parameters twice
    
    We set them later again when we calculate the vertical size, so just
    move the general assignment to -1 into the horizontal branch.

 gtk/gtklabel.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 6498a3b..1089242 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3767,12 +3767,6 @@ gtk_label_get_preferred_size (GtkWidget      *widget,
     gtk_misc_get_padding (GTK_MISC (label), &xpad, &ypad);
   G_GNUC_END_IGNORE_DEPRECATIONS
 
-  if (minimum_baseline)
-    *minimum_baseline = -1;
-
-  if (natural_baseline)
-    *natural_baseline = -1;
-
   gtk_label_get_preferred_layout_size (label, &smallest_rect, &widest_rect);
 
   /* Now that we have minimum and natural sizes in pango extents, apply a possible transform */
@@ -3837,6 +3831,12 @@ gtk_label_get_preferred_size (GtkWidget      *widget,
 
       *minimum_size += xpad * 2;
       *natural_size += xpad * 2;
+
+      if (minimum_baseline)
+        *minimum_baseline = -1;
+
+      if (natural_baseline)
+        *natural_baseline = -1;
     }
   else /* GTK_ORIENTATION_VERTICAL */
     {


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