freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] * src/truetype/ttgxvar.c (tt_var_get_it


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] * src/truetype/ttgxvar.c (tt_var_get_item_delta): Minor refactoring.
Date: Tue, 21 May 2024 03:11:07 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

  • 39f2fbf8
    by Alexei Podtelezhnikov (Алексей Подтележников) at 2024-05-20T22:47:14-04:00
    * src/truetype/ttgxvar.c (tt_var_get_item_delta): Minor refactoring.
    

1 changed file:

Changes:

  • src/truetype/ttgxvar.c
    ... ... @@ -1074,6 +1074,9 @@
    1074 1074
           /* inner loop steps through axes in this region */
    
    1075 1075
           for ( j = 0; j < itemStore->axisCount; j++, axis++ )
    
    1076 1076
           {
    
    1077
    +        FT_Fixed  ncv = ttface->blend->normalizedcoords[j];
    
    1078
    +
    
    1079
    +
    
    1077 1080
             /* compute the scalar contribution of this axis; */
    
    1078 1081
             /* ignore invalid ranges                         */
    
    1079 1082
             if ( axis->startCoord > axis->peakCoord ||
    
    ... ... @@ -1089,28 +1092,23 @@
    1089 1092
             else if ( axis->peakCoord == 0 )
    
    1090 1093
               continue;
    
    1091 1094
     
    
    1092
    -        else if ( ttface->blend->normalizedcoords[j] == axis->peakCoord )
    
    1093
    -          continue;
    
    1094
    -
    
    1095 1095
             /* ignore this region if coords are out of range */
    
    1096
    -        else if ( ttface->blend->normalizedcoords[j] <= axis->startCoord ||
    
    1097
    -                  ttface->blend->normalizedcoords[j] >= axis->endCoord   )
    
    1096
    +        else if ( ncv <= axis->startCoord ||
    
    1097
    +                  ncv >= axis->endCoord   )
    
    1098 1098
             {
    
    1099 1099
               scalar = 0;
    
    1100 1100
               break;
    
    1101 1101
             }
    
    1102 1102
     
    
    1103 1103
             /* cumulative product of all the axis scalars */
    
    1104
    -        else if ( ttface->blend->normalizedcoords[j] < axis->peakCoord )
    
    1105
    -          scalar =
    
    1106
    -            FT_MulDiv( scalar,
    
    1107
    -                       ttface->blend->normalizedcoords[j] - axis->startCoord,
    
    1108
    -                       axis->peakCoord - axis->startCoord );
    
    1109
    -        else
    
    1110
    -          scalar =
    
    1111
    -            FT_MulDiv( scalar,
    
    1112
    -                       axis->endCoord - ttface->blend->normalizedcoords[j],
    
    1113
    -                       axis->endCoord - axis->peakCoord );
    
    1104
    +        else if ( ncv < axis->peakCoord )
    
    1105
    +          scalar = FT_MulDiv( scalar,
    
    1106
    +                              ncv - axis->startCoord,
    
    1107
    +                              axis->peakCoord - axis->startCoord );
    
    1108
    +        else if ( ncv > axis->peakCoord )
    
    1109
    +          scalar = FT_MulDiv( scalar,
    
    1110
    +                              axis->endCoord - ncv,
    
    1111
    +                              axis->endCoord - axis->peakCoord );
    
    1114 1112
     
    
    1115 1113
           } /* per-axis loop */
    
    1116 1114
     
    


  • reply via email to

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