mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-13 12:41:31 +01: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
@ -347,7 +347,8 @@ const
|
|||||||
(* Get an outline's bounding box *)
|
(* Get an outline's bounding box *)
|
||||||
(* *)
|
(* *)
|
||||||
function TT_Get_Outline_BBox( var out : TT_Outline;
|
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 *)
|
(* Create a new glyph outline *)
|
||||||
@ -1337,7 +1338,8 @@ uses
|
|||||||
(* Compute an outline's bounding box *)
|
(* Compute an outline's bounding box *)
|
||||||
(* *)
|
(* *)
|
||||||
function TT_Get_Outline_BBox( var out : TT_Outline;
|
function TT_Get_Outline_BBox( var out : TT_Outline;
|
||||||
var bbox : TT_Bbox ) : TT_Error;
|
var bbox : TT_Bbox;
|
||||||
|
nbPhantomPoints : integer ) : TT_Error;
|
||||||
var
|
var
|
||||||
x, y : TT_Pos;
|
x, y : TT_Pos;
|
||||||
n : Int;
|
n : Int;
|
||||||
@ -1350,7 +1352,7 @@ uses
|
|||||||
yMin := $7FFFFFFF;
|
yMin := $7FFFFFFF;
|
||||||
yMax := -$80000000;
|
yMax := -$80000000;
|
||||||
|
|
||||||
for n := 0 to out.n_points-1 do
|
for n := 0 to out.n_points-1-nbPhantomPoints do
|
||||||
begin
|
begin
|
||||||
x := out.points^[n].x;
|
x := out.points^[n].x;
|
||||||
if x < xMin then xMin := x;
|
if x < xMin then xMin := x;
|
||||||
|
|||||||
@ -1233,7 +1233,7 @@ const
|
|||||||
glyph^.outline.n_contours := num_contours;
|
glyph^.outline.n_contours := num_contours;
|
||||||
glyph^.outline.second_pass := true;
|
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.horiBearingX := glyph^.metrics.bbox.xMin - subglyph^.pp1.x;
|
||||||
glyph^.metrics.horiBearingY := glyph^.metrics.bbox.yMax;
|
glyph^.metrics.horiBearingY := glyph^.metrics.bbox.yMax;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user