label: Fix an invariant leading to required > minimum

This commit is contained in:
Benjamin Otte 2011-04-22 02:51:52 +02:00
parent 6c24a25751
commit bf41392861

View File

@ -3568,6 +3568,11 @@ gtk_label_get_preferred_layout_size (GtkLabel *label,
layout = gtk_label_get_measuring_layout (label, layout, 0, -1);
pango_layout_get_extents (layout, NULL, required);
/* can happen when Pango decides to ellipsize text */
if (required->width > natural->width)
required->width = natural->width;
required->x = required->y = 0;
required->height = natural->height;
}