mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-11 01:48:17 +02:00
CairoCanvas, fix TextExtent, from Julio Jiménez Boreguero
git-svn-id: trunk@40725 -
This commit is contained in:
parent
5fc932cc76
commit
c5089fb28f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user