mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-06 14:05:05 +00:00
[gvar] Simplify ref_points logic
This commit is contained in:
parent
78a0216a03
commit
808a21f8de
1 changed files with 1 additions and 4 deletions
|
@ -333,14 +333,12 @@ struct gvar
|
|||
hb_memset (deltas.arrayZ, 0, deltas.get_size ());
|
||||
}
|
||||
|
||||
unsigned ref_points = 0;
|
||||
if (scalar != 1.0f)
|
||||
for (unsigned int i = 0; i < num_deltas; i++)
|
||||
{
|
||||
unsigned int pt_index = apply_to_all ? i : indices[i];
|
||||
if (unlikely (pt_index >= deltas.length)) continue;
|
||||
auto &delta = deltas.arrayZ[pt_index];
|
||||
ref_points += !delta.flag;
|
||||
delta.flag = 1; /* this point is referenced, i.e., explicit deltas specified */
|
||||
delta.x += x_deltas.arrayZ[i] * scalar;
|
||||
delta.y += y_deltas.arrayZ[i] * scalar;
|
||||
|
@ -351,14 +349,13 @@ struct gvar
|
|||
unsigned int pt_index = apply_to_all ? i : indices[i];
|
||||
if (unlikely (pt_index >= deltas.length)) continue;
|
||||
auto &delta = deltas.arrayZ[pt_index];
|
||||
ref_points += !delta.flag;
|
||||
delta.flag = 1; /* this point is referenced, i.e., explicit deltas specified */
|
||||
delta.x += x_deltas.arrayZ[i];
|
||||
delta.y += y_deltas.arrayZ[i];
|
||||
}
|
||||
|
||||
/* infer deltas for unreferenced points */
|
||||
if (ref_points && ref_points < points.length)
|
||||
if (!apply_to_all)
|
||||
{
|
||||
if (!end_points)
|
||||
for (unsigned i = 0; i < points.length; ++i)
|
||||
|
|
Loading…
Add table
Reference in a new issue