summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-11-08 23:15:19 +0100
committerBenjamin Otte <otte@redhat.com>2012-11-08 23:34:30 +0100
commit0d9a45d46006cf03afc1868130005736cf5a2d0c (patch)
tree6e2540442564da671241955b7b8057e8c51bcd39
parent947fed0961a26b7d017df18c3ad9723967574279 (diff)
downloadgtk+-0d9a45d46006cf03afc1868130005736cf5a2d0c.tar.gz
label: Fix another sizing corner case causing segfaults
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).
-rw-r--r--gtk/gtklabel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index a3c92838a7..92f55b6c14 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -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);
}