]> Pileus Git - ~andy/gtk/commitdiff
label: Fix another sizing corner case causing segfaults
authorBenjamin Otte <otte@redhat.com>
Thu, 8 Nov 2012 22:15:19 +0000 (23:15 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 8 Nov 2012 22:34:30 +0000 (23:34 +0100)
If the "wider" label is the smaller one, use the wider size for both
cases. This can happen when ellipsizing a single character, which is
often smaller than the ellipsizing glpyph(s).

gtk/gtklabel.c

index a3c92838a7284ce5ebe47cdd700f409761ff3b9c..92f55b6c14402f1050e816bc96252a4d393e4fba 100644 (file)
@@ -3557,7 +3557,8 @@ gtk_label_get_preferred_layout_size (GtkLabel *label,
       *smallest = *widest;
     }
 
-  g_assert (widest->width >= smallest->width);
+  if (widest->width < smallest->width)
+    *smallest = *widest;
 
   g_object_unref (layout);
 }