From e06de98c36200f7c6ff8939bb094960079521820 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 16 Dec 2022 11:31:00 -0700 Subject: [PATCH] [var-common] Make VarInstancer take an offset --- src/hb-ot-color-colr-table.hh | 8 ++++---- src/hb-ot-var-common.hh | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hb-ot-color-colr-table.hh b/src/hb-ot-color-colr-table.hh index 545448534..08fb5a073 100644 --- a/src/hb-ot-color-colr-table.hh +++ b/src/hb-ot-color-colr-table.hh @@ -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; diff --git a/src/hb-ot-var-common.hh b/src/hb-ot-var-common.hh index d9eff380d..4997c2e2e 100644 --- a/src/hb-ot-var-common.hh +++ b/src/hb-ot-var-common.hh @@ -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;