[var-common] Make VarInstancer take an offset

This commit is contained in:
Behdad Esfahbod 2022-12-16 11:31:00 -07:00
parent 251f9f6213
commit e06de98c36
2 changed files with 6 additions and 6 deletions

View File

@ -943,10 +943,10 @@ struct ClipBox
if (u.format == 2 && instancer)
{
uint32_t varIdx = u.format2.varIdxBase;
xmin += _hb_roundf (instancer (VarIdx::add (varIdx, 0)));
ymin += _hb_roundf (instancer (VarIdx::add (varIdx, 1)));
xmax += _hb_roundf (instancer (VarIdx::add (varIdx, 2)));
ymax += _hb_roundf (instancer (VarIdx::add (varIdx, 3)));
xmin += _hb_roundf (instancer (varIdx, 0));
ymin += _hb_roundf (instancer (varIdx, 1));
xmax += _hb_roundf (instancer (varIdx, 2));
ymax += _hb_roundf (instancer (varIdx, 3));
}
extents->x_bearing = xmin;
extents->y_bearing = ymax;

View File

@ -229,8 +229,8 @@ struct VarStoreInstancer
operator bool () const { return bool (coords); }
float operator() (uint32_t varIdx) const
{ return varStore.get_delta (varIdxMap.map (varIdx), coords); }
float operator() (uint32_t varIdx, unsigned short offset = 0) const
{ return varStore.get_delta (varIdxMap.map (VarIdx::add (varIdx, offset)), coords); }
const VariationStore &varStore;
const DeltaSetIndexMap &varIdxMap;