Commit 0fea8c56 authored by Jan Arne Petersen's avatar Jan Arne Petersen Committed by Jan Arne Petersen

Subtract logical.x from x to fix the wrong position for right and center

2008-05-25  Jan Arne Petersen  <jpetersen@jpetersen.org>

	* gtk/gtklabel.c: (get_layout_location): Subtract logical.x from x to
	fix the wrong position for right and center justified labels with
	logical.x > 0 (#530255).


svn path=/trunk/; revision=20146
parent 242f3309
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtklabel.c: (get_layout_location): Subtract logical.x from x to
fix the wrong position for right and center justified labels with
logical.x > 0 (#530255).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkfilechooserdefault.c:
......
......@@ -2661,6 +2661,7 @@ get_layout_location (GtkLabel *label,
GtkLabelPrivate *priv;
gfloat xalign;
gint req_width, x, y;
PangoRectangle logical;
misc = GTK_MISC (label);
widget = GTK_WIDGET (label);
......@@ -2671,13 +2672,13 @@ get_layout_location (GtkLabel *label,
else
xalign = 1.0 - misc->xalign;
pango_layout_get_pixel_extents (label->layout, NULL, &logical);
if (label->ellipsize || priv->width_chars > 0)
{
int width;
PangoRectangle logical;
width = pango_layout_get_width (label->layout);
pango_layout_get_pixel_extents (label->layout, NULL, &logical);
req_width = logical.width;
if (width != -1)
......@@ -2694,6 +2695,7 @@ get_layout_location (GtkLabel *label,
x = MAX (x, widget->allocation.x + misc->xpad);
else
x = MIN (x, widget->allocation.x + widget->allocation.width - misc->xpad);
x -= logical.x;
y = floor (widget->allocation.y + (gint)misc->ypad
+ MAX (((widget->allocation.height - widget->requisition.height) * misc->yalign),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment