freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype][master] * src/base/ftstroke.c (FT_Stroker_Parse


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] * src/base/ftstroke.c (FT_Stroker_ParseOutline): Clean up contour indexing.
Date: Mon, 20 Feb 2023 17:13:43 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

  • fecd19b4
    by Alexei Podtelezhnikov at 2023-02-20T17:13:40+00:00
    * src/base/ftstroke.c (FT_Stroker_ParseOutline): Clean up contour indexing.

1 changed file:

Changes:

  • src/base/ftstroke.c
    ... ... @@ -2055,7 +2055,9 @@
    2055 2055
         FT_Error    error;
    
    2056 2056
     
    
    2057 2057
         FT_Int      n;         /* index of contour in outline     */
    
    2058
    -    FT_UInt     first;     /* index of first point in contour */
    
    2058
    +    FT_Int      first;     /* index of first point in contour */
    
    2059
    +    FT_Int      last;      /* index of last point in contour  */
    
    2060
    +
    
    2059 2061
         FT_Int      tag;       /* current point's state           */
    
    2060 2062
     
    
    2061 2063
     
    
    ... ... @@ -2067,22 +2069,17 @@
    2067 2069
     
    
    2068 2070
         FT_Stroker_Rewind( stroker );
    
    2069 2071
     
    
    2070
    -    first = 0;
    
    2071
    -
    
    2072
    +    last = -1;
    
    2072 2073
         for ( n = 0; n < outline->n_contours; n++ )
    
    2073 2074
         {
    
    2074
    -      FT_UInt  last;  /* index of last point in contour */
    
    2075
    -
    
    2076
    -
    
    2077
    -      last  = (FT_UInt)outline->contours[n];
    
    2078
    -      limit = outline->points + last;
    
    2075
    +      first = last + 1;
    
    2076
    +      last  = outline->contours[n];
    
    2079 2077
     
    
    2080 2078
           /* skip empty points; we don't stroke these */
    
    2081 2079
           if ( last <= first )
    
    2082
    -      {
    
    2083
    -        first = last + 1;
    
    2084 2080
             continue;
    
    2085
    -      }
    
    2081
    +
    
    2082
    +      limit = outline->points + last;
    
    2086 2083
     
    
    2087 2084
           v_start = outline->points[first];
    
    2088 2085
           v_last  = outline->points[last];
    
    ... ... @@ -2231,8 +2228,6 @@
    2231 2228
             if ( error )
    
    2232 2229
               goto Exit;
    
    2233 2230
           }
    
    2234
    -
    
    2235
    -      first = last + 1;
    
    2236 2231
         }
    
    2237 2232
     
    
    2238 2233
         return FT_Err_Ok;
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]