Use logical extents of the layout instead of ink extents. According to
2006-01-25 Behdad Esfahbod <behdad@gnome.org> * gtk/gtklabel.c (get_layout_location): Use logical extents of the layout instead of ink extents. According to Pango docs, that's what should be used for placement. Moreover, simply use pango_layout_get_pixel_size instead of getting the extents and dividing ourselves.
This commit is contained in:

committed by
Behdad Esfahbod

parent
2ec7ee28b8
commit
2990e0d796
@ -1,3 +1,11 @@
|
|||||||
|
2006-01-25 Behdad Esfahbod <behdad@gnome.org>
|
||||||
|
|
||||||
|
* gtk/gtklabel.c (get_layout_location): Use logical extents of the
|
||||||
|
layout instead of ink extents. According to Pango docs, that's what
|
||||||
|
should be used for placement. Moreover, simply use
|
||||||
|
pango_layout_get_pixel_size instead of getting the extents and
|
||||||
|
dividing ourselves.
|
||||||
|
|
||||||
2006-01-25 Matthias Clasen <mclasen@redhat.com>
|
2006-01-25 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gdk/x11/gdkcursor-x11.c (gdk_x11_display_set_cursor_theme): Only
|
* gdk/x11/gdkcursor-x11.c (gdk_x11_display_set_cursor_theme): Only
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
2006-01-25 Behdad Esfahbod <behdad@gnome.org>
|
||||||
|
|
||||||
|
* gtk/gtklabel.c (get_layout_location): Use logical extents of the
|
||||||
|
layout instead of ink extents. According to Pango docs, that's what
|
||||||
|
should be used for placement. Moreover, simply use
|
||||||
|
pango_layout_get_pixel_size instead of getting the extents and
|
||||||
|
dividing ourselves.
|
||||||
|
|
||||||
2006-01-25 Matthias Clasen <mclasen@redhat.com>
|
2006-01-25 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gdk/x11/gdkcursor-x11.c (gdk_x11_display_set_cursor_theme): Only
|
* gdk/x11/gdkcursor-x11.c (gdk_x11_display_set_cursor_theme): Only
|
||||||
|
@ -2221,19 +2221,13 @@ get_layout_location (GtkLabel *label,
|
|||||||
if (label->ellipsize || priv->width_chars > 0)
|
if (label->ellipsize || priv->width_chars > 0)
|
||||||
{
|
{
|
||||||
int width;
|
int width;
|
||||||
PangoRectangle ink_rect;
|
|
||||||
|
|
||||||
width = pango_layout_get_width (label->layout);
|
width = pango_layout_get_width (label->layout);
|
||||||
if (width == -1)
|
if (width == -1)
|
||||||
{
|
pango_layout_get_pixel_size (label->layout, &req_width, NULL);
|
||||||
pango_layout_get_extents (label->layout, &ink_rect, NULL);
|
|
||||||
req_width = PANGO_PIXELS (ink_rect.width);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
req_width = PANGO_PIXELS (width);
|
req_width = PANGO_PIXELS (width);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
req_width = widget->requisition.width;
|
req_width = widget->requisition.width;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user