[gtk+/gtk-3-0] label: Compute label offset properly for wrapped justified labels
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-0] label: Compute label offset properly for wrapped justified labels
- Date: Thu, 5 May 2011 16:15:42 +0000 (UTC)
commit 9917861cb1cc266854eaaf10bf8f335cdf43cd72
Author: Benjamin Otte <otte redhat com>
Date: Thu May 5 17:30:58 2011 +0200
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.
gtk/gtklabel.c | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 0d795d4..4f90252 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3887,12 +3887,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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]