mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 17:49:28 +02:00
LazUtils: Fix LazFreeType glyph bounds. Issue #37022, patch from circular.
git-svn-id: trunk@63126 -
This commit is contained in:
parent
8fccfb64ef
commit
d96645d9ff
components/lazutils
@ -347,7 +347,8 @@ const
|
||||
(* Get an outline's bounding box *)
|
||||
(* *)
|
||||
function TT_Get_Outline_BBox( var out : TT_Outline;
|
||||
var bbox : TT_Bbox ) : TT_Error;
|
||||
var bbox : TT_Bbox;
|
||||
nbPhantomPoints : integer = 0 ) : TT_Error;
|
||||
|
||||
(*****************************************************************)
|
||||
(* Create a new glyph outline *)
|
||||
@ -1337,7 +1338,8 @@ uses
|
||||
(* Compute an outline's bounding box *)
|
||||
(* *)
|
||||
function TT_Get_Outline_BBox( var out : TT_Outline;
|
||||
var bbox : TT_Bbox ) : TT_Error;
|
||||
var bbox : TT_Bbox;
|
||||
nbPhantomPoints : integer ) : TT_Error;
|
||||
var
|
||||
x, y : TT_Pos;
|
||||
n : Int;
|
||||
@ -1350,7 +1352,7 @@ uses
|
||||
yMin := $7FFFFFFF;
|
||||
yMax := -$80000000;
|
||||
|
||||
for n := 0 to out.n_points-1 do
|
||||
for n := 0 to out.n_points-1-nbPhantomPoints do
|
||||
begin
|
||||
x := out.points^[n].x;
|
||||
if x < xMin then xMin := x;
|
||||
|
@ -1233,7 +1233,7 @@ const
|
||||
glyph^.outline.n_contours := num_contours;
|
||||
glyph^.outline.second_pass := true;
|
||||
|
||||
TT_Get_Outline_BBox( glyph^.outline, glyph^.metrics.bbox );
|
||||
TT_Get_Outline_BBox( glyph^.outline, glyph^.metrics.bbox, 2 );
|
||||
|
||||
glyph^.metrics.horiBearingX := glyph^.metrics.bbox.xMin - subglyph^.pp1.x;
|
||||
glyph^.metrics.horiBearingY := glyph^.metrics.bbox.yMax;
|
||||
|
Loading…
Reference in New Issue
Block a user