summaryrefslogtreecommitdiff
path: root/gtk/gtklabel.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2007-01-05 18:05:15 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2007-01-05 18:05:15 +0000
commite4dc23c48e411f6e1dd635a3797b265a70d1a2e9 (patch)
tree90f1b82d88fc59598293b6a185386c5ea54ec3ab /gtk/gtklabel.c
parent34039c7008ddae46d5cd59ff4dd3a5b57f026bfe (diff)
downloadgtk+-e4dc23c48e411f6e1dd635a3797b265a70d1a2e9.tar.gz
Fix broken width computation, again.
2007-01-05 Behdad Esfahbod <behdad@gnome.org> * gtk/gtklabel.c (get_layout_location): Fix broken width computation, again. svn path=/trunk/; revision=17083
Diffstat (limited to 'gtk/gtklabel.c')
-rw-r--r--gtk/gtklabel.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 219f01e898..e479bf4391 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -2301,8 +2301,9 @@ get_layout_location (GtkLabel *label,
width = pango_layout_get_width (label->layout);
pango_layout_get_pixel_extents (label->layout, NULL, &logical);
- /* width may be -1 */
- req_width = MIN(PANGO_PIXELS (width), logical.width);
+ req_width = logical.width;
+ if (width != -1)
+ req_width = MIN(PANGO_PIXELS (width), req_width);
req_width += 2 * misc->xpad;
}
else