[gtk+/wip/baseline3] GtkLabel: Minor cleanup



commit 90ab5e6a26d1f34967cf7b70cc68683913e32751
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Mar 27 09:44:02 2013 +0100

    GtkLabel: Minor cleanup
    
    Make sure we always compare for a set baseline in the same way.
    I.e. baseline != -1, never baseline >= 0.

 gtk/gtklabel.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 74a4214..eac6741 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3801,9 +3801,9 @@ gtk_label_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
                                minimum_height, natural_height,
                               minimum_baseline, natural_baseline);
 
-      if (minimum_baseline && *minimum_baseline >= 0)
+      if (minimum_baseline && *minimum_baseline != -1)
        *minimum_baseline += border.top;
-      if (natural_baseline && *natural_baseline >= 0)
+      if (natural_baseline && *natural_baseline != -1)
        *natural_baseline += border.top;
 
       if (minimum_height)
@@ -3954,7 +3954,7 @@ get_layout_location (GtkLabel  *label,
 
   baseline_offset = 0;
   baseline = gtk_widget_get_allocated_baseline (widget);
-  if (baseline >= 0 && !priv->have_transform)
+  if (baseline != -1 && !priv->have_transform)
     {
       layout_baseline = pango_layout_get_baseline (priv->layout) / PANGO_SCALE;
       baseline_offset = baseline - layout_baseline;


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