summaryrefslogtreecommitdiff
path: root/gtk/gtklabel.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-05-05 17:30:58 +0200
committerBenjamin Otte <otte@redhat.com>2011-05-05 17:33:44 +0200
commit33e6479554a540b63705c0ea8fa07cb05311184e (patch)
tree40f338e6153ca0965adacb060b224db5086a13d6 /gtk/gtklabel.c
parent278260a3ae53207fe9b2c19c8dcd1bd763c71192 (diff)
downloadgtk+-33e6479554a540b63705c0ea8fa07cb05311184e.tar.gz
label: Compute label offset properly for wrapped justified labels
label offsets were computed wrong for wrapped or ellipsized labels that were right- or center-justified and had excess space available.
Diffstat (limited to 'gtk/gtklabel.c')
-rw-r--r--gtk/gtklabel.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 3b6504e346..9b9752bc2d 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3949,12 +3949,7 @@ get_layout_location (GtkLabel *label,
gtk_widget_get_allocation (widget, &allocation);
- x = floor (allocation.x + xpad + xalign * (allocation.width - req_width));
-
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
- x = MAX (x, allocation.x + xpad);
- else
- x = MIN (x, allocation.x + allocation.width - xpad);
+ x = floor (allocation.x + xpad + xalign * (allocation.width - req_width) - logical.x);
/* bgo#315462 - For single-line labels, *do* align the requisition with