diff options
author | Benjamin Otte <otte@redhat.com> | 2011-04-22 02:51:52 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-04-22 02:51:52 +0200 |
commit | bf413928611e004ae3b5a9f73ff9c777cb7e8e70 (patch) | |
tree | 26226d2c212005e693459f73655bbe3b2761dcd7 /gtk/gtklabel.c | |
parent | 6c24a257513844777997d51239031e861d7b4475 (diff) | |
download | gtk+-bf413928611e004ae3b5a9f73ff9c777cb7e8e70.tar.gz |
label: Fix an invariant leading to required > minimum
Diffstat (limited to 'gtk/gtklabel.c')
-rw-r--r-- | gtk/gtklabel.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 3f83745911..45531d8ae0 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -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; } |