CairoCanvas, fix TextExtent, from Julio Jiménez Boreguero

git-svn-id: trunk@40725 -
This commit is contained in:
jesus 2013-04-06 19:51:11 +00:00
parent 5fc932cc76
commit c5089fb28f

View File

@ -1005,9 +1005,9 @@ begin
pango_layout_set_font_description(Layout, fFontDesc);
cairo_text_extents(cr, PChar(Text), @extents);
pango_layout_set_text(Layout, pchar(Text), -1);
pango_layout_get_extents(Layout, @theRect, nil);
Result.cx := Round((theRect.width/PANGO_SCALE)/ScaleX-extents.x_bearing);
Result.cy := Round((theRect.height/PANGO_SCALE)/ScaleY-extents.y_bearing);
pango_layout_get_extents(Layout, nil, @theRect);
Result.cx := Round((theRect.width/PANGO_SCALE)/ScaleX);
Result.cy := Round((theRect.height/PANGO_SCALE)/ScaleY);
g_object_unref(Layout);
{$else}
cairo_text_extents(cr, PChar(Text), @extents); //transformation matrix is here ignored