diff options
author | Alexei Podtelezhnikov <apodtele@gmail.com> | 2023-02-21 16:17:07 +0000 |
---|---|---|
committer | Alexei Podtelezhnikov <apodtele@gmail.com> | 2023-02-21 16:17:07 +0000 |
commit | 3f01161ff22c84c371b6dc3b5e0351e0d6e8e771 (patch) | |
tree | a77f13e6af44d18e82939c05fba42785a9232d74 /src/raster/ftraster.c | |
parent | 7f9499044e3baa901de99251a007aa66e750b26c (diff) | |
download | freetype2-3f01161ff22c84c371b6dc3b5e0351e0d6e8e771.tar.gz |
[raster] Clean up contour indexing.
* src/raster/ftraster.c (Decompose_Curve, Convert_Glyph): Use consistent
index types (Int) and compact iterations.
Diffstat (limited to 'src/raster/ftraster.c')
-rw-r--r-- | src/raster/ftraster.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c index 67cbfd5d9..59b27a408 100644 --- a/src/raster/ftraster.c +++ b/src/raster/ftraster.c @@ -1742,9 +1742,9 @@ * SUCCESS on success, FAILURE on error. */ static Bool - Decompose_Curve( RAS_ARGS UShort first, - UShort last, - Int flipped ) + Decompose_Curve( RAS_ARGS Int first, + Int last, + Int flipped ) { FT_Vector v_last; FT_Vector v_control; @@ -1969,8 +1969,8 @@ static Bool Convert_Glyph( RAS_ARGS Int flipped ) { - Int i; - UInt start; + Int i; + Int first, last; ras.fProfile = NULL; @@ -1985,8 +1985,7 @@ ras.cProfile->offset = ras.top; ras.num_Profs = 0; - start = 0; - + last = -1; for ( i = 0; i < ras.outline.n_contours; i++ ) { PProfile lastProfile; @@ -1996,12 +1995,11 @@ ras.state = Unknown_State; ras.gProfile = NULL; - if ( Decompose_Curve( RAS_VARS (UShort)start, - (UShort)ras.outline.contours[i], - flipped ) ) - return FAILURE; + first = last + 1; + last = ras.outline.contours[i]; - start = (UShort)ras.outline.contours[i] + 1; + if ( Decompose_Curve( RAS_VARS first, last, flipped ) ) + return FAILURE; /* we must now check whether the extreme arcs join or not */ if ( FRAC( ras.lastY ) == 0 && |