]> Pileus Git - ~andy/gtk/commitdiff
Use logical extents of the layout instead of ink extents. According to
authorBehdad Esfahbod <behdad@gnome.org>
Wed, 25 Jan 2006 16:23:33 +0000 (16:23 +0000)
committerBehdad Esfahbod <behdad@src.gnome.org>
Wed, 25 Jan 2006 16:23:33 +0000 (16:23 +0000)
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.

ChangeLog
ChangeLog.pre-2-10
gtk/gtklabel.c

index 876eb05ee55e423d57be6fb77a4f4af862b436a6..70985610490d1f9d5444bd71b168ce26e8072020 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * gdk/x11/gdkcursor-x11.c (gdk_x11_display_set_cursor_theme): Only
index 876eb05ee55e423d57be6fb77a4f4af862b436a6..70985610490d1f9d5444bd71b168ce26e8072020 100644 (file)
@@ -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>
 
        * gdk/x11/gdkcursor-x11.c (gdk_x11_display_set_cursor_theme): Only
index 79c5be1c48b22b38c57d1503f9d6031795836ee2..1ad227dc7a7f54adb9fd7d2c19f6a19d73a83b96 100644 (file)
@@ -2221,18 +2221,12 @@ get_layout_location (GtkLabel  *label,
   if (label->ellipsize || priv->width_chars > 0)
     {
       int width;
-      PangoRectangle ink_rect;
 
       width = pango_layout_get_width (label->layout);
       if (width == -1)
-        {
-         pango_layout_get_extents (label->layout, &ink_rect, NULL);
-         req_width = PANGO_PIXELS (ink_rect.width);
-       }
+       pango_layout_get_pixel_size (label->layout, &req_width, NULL);
       else
-       {
-         req_width = PANGO_PIXELS (width);
-       }
+       req_width = PANGO_PIXELS (width);
     }
   else
     req_width = widget->requisition.width;