* BUG: Now there is no segmentation fault on running.


git-svn-id: svn://localhost/gambas/trunk@2586 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Fabien Bodard 2010-01-01 23:13:56 +00:00
parent 5a319b4eb5
commit f543f61634

View file

@ -654,20 +654,19 @@ static void TextExtents(GB_PAINT *d, const char *text, int len, GB_EXTENTS *ext)
{
PangoLayout *layout;
CFONT *font;
PangoRectangle *rect;
PangoRectangle *logrect;
PangoRectangle rect;
PangoRectangle logrect;
layout = pango_cairo_create_layout(CONTEXT(d));
Paint_Font(d, FALSE, (GB_FONT *)&font);
gt_add_layout_from_font(layout, font->font);
pango_layout_set_text(layout, text, len);
pango_layout_get_extents(layout, rect, logrect);
pango_layout_get_extents(layout, &rect, &logrect);
ext->x2 = (float)rect->width;
ext->y2 = (float)rect->height;
ext->x2 = rect.width;
ext->y2 = rect.height;
g_object_unref(layout);
g_object_unref(rect);
g_object_unref(logrect);
}