summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype2/freetype-src/src/base/ftstroke.c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2021-08-29 06:19:44 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2021-08-29 06:19:44 +0000
commit0de5be92a3a0fe27e8521fc4de67e19b1057842e (patch)
treee93a390fe965486cca19498840cb8d7904252fec /Build/source/libs/freetype2/freetype-src/src/base/ftstroke.c
parent27ce96eea3f1190bd744448cfa149e8d767af95a (diff)
revert freetype to 2.10.4
git-svn-id: svn://tug.org/texlive/trunk@60360 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/base/ftstroke.c')
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftstroke.c47
1 files changed, 33 insertions, 14 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftstroke.c b/Build/source/libs/freetype2/freetype-src/src/base/ftstroke.c
index 37e9649411f..56f98e1d928 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftstroke.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftstroke.c
@@ -4,7 +4,7 @@
*
* FreeType path stroker (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2020 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -974,8 +974,7 @@
FT_StrokeBorder border = stroker->borders + side;
FT_Angle phi, theta, rotate;
FT_Fixed length;
- FT_Vector sigma = { 0, 0 };
- FT_Vector delta;
+ FT_Vector sigma, delta;
FT_Error error = FT_Err_Ok;
FT_Bool intersect; /* use intersection of lines? */
@@ -1049,7 +1048,7 @@
{
/* this is a mitered (pointed) or beveled (truncated) corner */
FT_Fixed radius = stroker->radius;
- FT_Vector sigma = { 0, 0 };
+ FT_Vector sigma;
FT_Angle theta = 0, phi = 0;
FT_Bool bevel, fixed_bevel;
@@ -1529,8 +1528,7 @@
stroker->angle_in = angle_out;
}
- stroker->center = *to;
- stroker->line_length = 0;
+ stroker->center = *to;
Exit:
return error;
@@ -1746,8 +1744,7 @@
stroker->angle_in = angle_out;
}
- stroker->center = *to;
- stroker->line_length = 0;
+ stroker->center = *to;
Exit:
return error;
@@ -1900,9 +1897,13 @@
}
else
{
+ FT_Angle turn;
+ FT_Int inside_side;
+
+
/* close the path if needed */
- if ( !FT_IS_SMALL( stroker->center.x - stroker->subpath_start.x ) ||
- !FT_IS_SMALL( stroker->center.y - stroker->subpath_start.y ) )
+ if ( stroker->center.x != stroker->subpath_start.x ||
+ stroker->center.y != stroker->subpath_start.y )
{
error = FT_Stroker_LineTo( stroker, &stroker->subpath_start );
if ( error )
@@ -1911,11 +1912,29 @@
/* process the corner */
stroker->angle_out = stroker->subpath_angle;
+ turn = FT_Angle_Diff( stroker->angle_in,
+ stroker->angle_out );
- error = ft_stroker_process_corner( stroker,
- stroker->subpath_line_length );
- if ( error )
- goto Exit;
+ /* no specific corner processing is required if the turn is 0 */
+ if ( turn != 0 )
+ {
+ /* when we turn to the right, the inside side is 0 */
+ /* otherwise, the inside side is 1 */
+ inside_side = ( turn < 0 );
+
+ error = ft_stroker_inside( stroker,
+ inside_side,
+ stroker->subpath_line_length );
+ if ( error )
+ goto Exit;
+
+ /* process the outside side */
+ error = ft_stroker_outside( stroker,
+ !inside_side,
+ stroker->subpath_line_length );
+ if ( error )
+ goto Exit;
+ }
/* then end our two subpaths */
ft_stroke_border_close( stroker->borders + 0, FALSE );