infer gvar deltas for each region (not after accumulation)
This commit is contained in:
parent
2c31652c8a
commit
ee58f6012e
|
@ -598,8 +598,6 @@ struct gvar
|
|||
|
||||
contour_point_vector_t deltas; /* flag is used to indicate referenced point */
|
||||
deltas.resize (points.length);
|
||||
for (unsigned int i = 0; i < deltas.length; i++)
|
||||
deltas[i].init ();
|
||||
|
||||
do {
|
||||
float scalar = iterator.current_tuple->calculate_scalar (coords, coord_count, shared_tuples.as_array ());
|
||||
|
@ -627,6 +625,8 @@ struct gvar
|
|||
if (!GlyphVarData::unpack_deltas (p, y_deltas, checker))
|
||||
return false;
|
||||
|
||||
for (unsigned int i = 0; i < deltas.length; i++)
|
||||
deltas[i].init ();
|
||||
for (unsigned int i = 0; i < num_deltas; i++)
|
||||
{
|
||||
unsigned int pt_index = apply_to_all? i: indices[i];
|
||||
|
@ -634,7 +634,6 @@ struct gvar
|
|||
deltas[pt_index].x += x_deltas[i] * scalar;
|
||||
deltas[pt_index].y += y_deltas[i] * scalar;
|
||||
}
|
||||
} while (iterator.move_to_next ());
|
||||
|
||||
/* infer deltas for unreferenced points */
|
||||
contour_point_vector_t orig_points;
|
||||
|
@ -670,12 +669,13 @@ struct gvar
|
|||
start_point = end_point + 1;
|
||||
}
|
||||
|
||||
/* apply accumulated / inferred deltas to points */
|
||||
/* apply specified / inferred deltas to points */
|
||||
for (unsigned int i = 0; i < points.length; i++)
|
||||
{
|
||||
points[i].x += deltas[i].x;
|
||||
points[i].y += deltas[i].y;
|
||||
}
|
||||
} while (iterator.move_to_next ());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue