提交 54b2b937 编写于 作者: B Behdad Esfahbod

[ot] Fix VariationStore evaluation algorithm

Ouch!  Missing coords should still be evaluated as coord=0, which
most of the time results in a factor of 0.  We were skipping these,
which was equivalent to a factor of 1.

Fixes https://github.com/harfbuzz/harfbuzz/issues/652
上级 a3afdd1e
...@@ -1275,10 +1275,11 @@ struct VarRegionList ...@@ -1275,10 +1275,11 @@ struct VarRegionList
const VarRegionAxis *axes = axesZ + (region_index * axisCount); const VarRegionAxis *axes = axesZ + (region_index * axisCount);
float v = 1.; float v = 1.;
unsigned int count = MIN (coord_len, (unsigned int) axisCount); unsigned int count = axisCount;
for (unsigned int i = 0; i < count; i++) for (unsigned int i = 0; i < count; i++)
{ {
float factor = axes[i].evaluate (coords[i]); int coord = i < coord_len ? coords[i] : 0;
float factor = axes[i].evaluate (coord);
if (factor == 0.) if (factor == 0.)
return 0.; return 0.;
v *= factor; v *= factor;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册