diff options
author | Thomas White <taw@bitwiz.org.uk> | 2012-10-09 21:56:08 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2012-10-09 21:56:08 +0200 |
commit | eea7bf93ada2a57fad1dac3e5233f703d1af02ff (patch) | |
tree | 48ec353ba3c5e705e980cb886cf4026418ef2161 /src/layout.c | |
parent | 43f4a4df59d960442df2faedfd50e5c7c7a55d99 (diff) |
Set frame size to the size of contents
Diffstat (limited to 'src/layout.c')
-rw-r--r-- | src/layout.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/layout.c b/src/layout.c index ae7a5e8..cef270d 100644 --- a/src/layout.c +++ b/src/layout.c @@ -56,6 +56,7 @@ static void layout_subframe(struct frame *fr, double w, double h, double child_w, child_h; double offs_x, offs_y; PangoFontDescription *fontdesc; + PangoRectangle extents; child = fr->rendering_order[i]; @@ -89,6 +90,10 @@ static void layout_subframe(struct frame *fr, double w, double h, pango_layout_set_font_description(child->pl, fontdesc); pango_font_description_free(fontdesc); + pango_layout_get_extents(child->pl, NULL, &extents); + child_w = extents.width / PANGO_SCALE; + child_h = extents.height / PANGO_SCALE; + /* Now, apply the minimum size if given */ if ( child->lop.min_w > 0.0 ) { if ( child_w < child->lop.min_w ) { |