changeset 2235:e7cbef69e9e0

Fixed layout size calculation to take italicized glyph extents into account.
author Eugene Paskevich <eugene@raptor.kiev.ua>
date Sun, 16 Dec 2007 11:41:14 +0200
parents 9d2d7061caed
children 2769f4aaa2fd
files src/aosd/aosd_osd.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/aosd/aosd_osd.c	Sat Dec 15 01:17:05 2007 +0900
+++ b/src/aosd/aosd_osd.c	Sun Dec 16 11:41:14 2007 +0200
@@ -179,6 +179,7 @@
 aosd_osd_create ( void )
 {
   gint max_width, layout_width, layout_height;
+  PangoRectangle ink;
   GdkScreen *screen = gdk_screen_get_default();
   gint pos_x = 0, pos_y = 0;
   gint pad_left = 0 , pad_right = 0 , pad_top = 0 , pad_bottom = 0;
@@ -228,7 +229,9 @@
   pango_layout_set_ellipsize( osd_data->pango_layout , PANGO_ELLIPSIZE_NONE );
   pango_layout_set_justify( osd_data->pango_layout , FALSE );
   pango_layout_set_width( osd_data->pango_layout , PANGO_SCALE * max_width );
-  pango_layout_get_pixel_size( osd_data->pango_layout , &layout_width , &layout_height );
+  pango_layout_get_pixel_extents( osd_data->pango_layout , &ink , NULL );
+  layout_width = ink.x + ink.width;
+  layout_height = ink.y + ink.height;
 
   /* osd position */
   switch ( osd_data->cfg_osd->position.placement )