[varc] Simplify a bit

pull/4578/head
Behdad Esfahbod 12 months ago
parent 7b57a8a40e
commit 0ee6164a4c
  1. 11
      src/hb-ot-layout-common.hh

@ -2511,7 +2511,12 @@ struct VarRegionAxis
};
struct SparseVarRegionAxis
{
float evaluate (int coord) const { return axis.evaluate (coord); }
float evaluate (const int *coords, unsigned int coord_len) const
{
unsigned i = axisIndex;
int coord = i < coord_len ? coords[i] : 0;
return axis.evaluate (coord);
}
bool sanitize (hb_sanitize_context_t *c) const
{
@ -2703,9 +2708,7 @@ struct SparseVariationRegion : Array16Of<SparseVarRegionAxis>
unsigned int count = len;
for (unsigned int i = 0; i < count; i++)
{
unsigned j = arrayZ[i].axisIndex;
int coord = j < coord_len ? coords[j] : 0;
float factor = arrayZ[i].evaluate (coord);
float factor = arrayZ[i].evaluate (coords, coord_len);
if (factor == 0.f)
return 0.;
v *= factor;

Loading…
Cancel
Save