diff options
author | 2010-02-07 22:20:19 +0100 | |
---|---|---|
committer | 2010-02-07 22:20:19 +0100 | |
commit | d7644e273f412f9e6fa5dff8d39daba1e8be5228 (patch) | |
tree | 0f3d2f8988bb13859684ecf784f092ec8c2c3789 /plugins/gtkui/gdkdrawing.c | |
parent | ed94b40b44f283b4ef8c22ee731b59c8faa6d22b (diff) |
tabs for multiple playlists WIP
Diffstat (limited to 'plugins/gtkui/gdkdrawing.c')
-rw-r--r-- | plugins/gtkui/gdkdrawing.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/gtkui/gdkdrawing.c b/plugins/gtkui/gdkdrawing.c index b2fe9710..29238689 100644 --- a/plugins/gtkui/gdkdrawing.c +++ b/plugins/gtkui/gdkdrawing.c @@ -142,9 +142,14 @@ draw_text_with_colors (float x, float y, int width, int align, const char *text) void draw_get_text_extents (const char *text, int len, int *w, int *h) { draw_init_font (); + pango_layout_set_width (pangolayout, 1000 * PANGO_SCALE); + pango_layout_set_alignment (pangolayout, PANGO_ALIGN_LEFT); pango_layout_set_text (pangolayout, text, len); - PangoRectangle ext; - pango_layout_get_pixel_extents (pangolayout, &ext, NULL); - *w = ext.width; - *h = ext.height; + PangoRectangle ink; + PangoRectangle log; + pango_layout_get_pixel_extents (pangolayout, &ink, &log); + *w = ink.width; + *h = ink.height; + printf ("ink: %d %d %d %d\n", ink.x, ink.y, ink.width, ink.height); + printf ("log: %d %d %d %d\n", log.x, log.y, log.width, log.height); } |